diff --git a/src/streamDeck.js b/src/streamDeck.js index 1bc6f48..8482eba 100644 --- a/src/streamDeck.js +++ b/src/streamDeck.js @@ -61,7 +61,7 @@ export class StreamDeck{ clearContext(device,action,coordinates = {column:0,row:0}){ for (let d of this.buttonContext) { - if (d.device == device) { + if (d?.device == device) { const num = coordinates.column + coordinates.row*d.size.columns; d.buttons[num] = undefined; return; @@ -241,7 +241,7 @@ export class StreamDeck{ //if (src != 'modules/MaterialDeck/img/black.png') for (let d of this.buttonContext) { - if (d.device == device) { + if (d?.device == device) { for (let i=0; i