Args won't always be present

This commit is contained in:
Dane Everitt 2019-09-24 22:05:48 -07:00
parent 030b8ed4fd
commit b78276d23d
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -29,7 +29,7 @@ export class Websocket extends EventEmitter {
onmessage: e => {
try {
let { event, args } = JSON.parse(e.data);
this.emit(event, ...args);
args ? this.emit(event, ...args) : this.emit(event);
} catch (ex) {
console.warn('Failed to parse incoming websocket message.', ex);
}