Skip to content

Commit

Permalink
Fix getMemoryUsage null property crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Flechaa authored Jan 2, 2025
1 parent 109ba13 commit 2cbe9cd
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 @@ -164,7 +164,7 @@ export class DeviceControlConnection extends EventEmitter {
//< {"id":7,"status":200,"body":{"memFree":123, ...}}

const memory = await this.executeCommand<MemoryStatus>('getMemoryUsage', null, 5000);
if (typeof memory === 'object') {
if (typeof memory === 'object' && !Array.isArray(msg) && msg != null) {
this.lastMemory = memory; // spy on result
}
return memory;
Expand Down

0 comments on commit 2cbe9cd

Please sign in to comment.