Skip to content

Commit

Permalink
Fix crash should devices list be empty in config file
Browse files Browse the repository at this point in the history
  • Loading branch information
mhawkshaw committed Mar 25, 2023
1 parent 8e35bda commit 49574f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"displayName": "Homebridge Enviroplus",
"name": "homebridge-enviroplus",
"version": "2.1.4",
"version": "2.1.5",
"description": "Fetches information from Raspberry Pi Enviroplus sensors for air quality.",
"license": "Apache-2.0",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class EnviroplusPlatform implements DynamicPlatformPlugin {
provided = provided && device.displayName && device.serial && device.topic;
}
}
} else if (this.config.devices) {
} else {
provided = false;
this.log.error('The devices property is not of type array. Cannot initialise. Type %s', typeof this.config.devices);
this.log.error('The devices property is not of type array or is empty. Cannot initialise. Type %s', typeof this.config.devices);
}
return provided;
}
Expand Down

0 comments on commit 49574f6

Please sign in to comment.