obs-websocket-community-projects / obs-websocket-js

Consumes https://github.com/obsproject/obs-websocket
MIT License
661 stars 95 forks source link

Check that the send function's "args" parameter is actually an object #226

Closed zoton2 closed 3 years ago

zoton2 commented 3 years ago

Related Issue (if applicable):

223

Description:

This adds a simple check to the send function to make sure the supplied arguments parameter is actually an object (excluding arrays) and throws an error if not.

Added because of the referenced issue above where the author was able to supply an array, which the JavaScript somehow attempts to convert into a (broken) object, which gets sent without a message-id, and then the plugin returns an error message but because there is no message-id the send function gets stuck/hangs.