Skip to content

Commit

Permalink
Fix null message crash and drop array messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Flechaa authored Jan 2, 2025
1 parent c57e6e4 commit 109ba13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/connections/src/lib/deviceControlConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class DeviceControlConnection extends EventEmitter {
// Do nothing
}

if (typeof msg !== 'object') {
if (typeof msg !== 'object' || Array.isArray(msg) || msg == null) {
this.log.error(`Device /control - error decoding message, disconnecting`);
this.ws.close();
return;
Expand Down

0 comments on commit 109ba13

Please sign in to comment.