Skip to content

Commit

Permalink
Fix crash for model undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Luligu committed Jul 9, 2024
1 parent 2a3d62b commit 0aad99a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export class ShellyPlatform extends MatterbridgeDynamicPlatform {
}
if (config.debug) device.logDevice();

if (device.name === undefined || device.id === undefined || device.model === undefined || device.firmware === undefined) {
this.log.error(`Shelly device ${hk}${device.id}${er} host ${zb}${device.host}${er} is not valid. Please put it in the blackList and open an issue.`);
return;
}
// Create a new Matterbridge device for the switch
const mbDevice = new MatterbridgeDevice(bridgedNode, undefined, config.debug as boolean);
mbDevice.createDefaultBridgedDeviceBasicInformationClusterServer(
Expand Down

0 comments on commit 0aad99a

Please sign in to comment.