Skip to content

Commit

Permalink
77: fix unhandled config exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Schroeder authored and Paul Schroeder committed Apr 13, 2024
1 parent 055695e commit 69cf69b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Levoit Humidifiers",
"main": "dist/index.js",
"license": "Apache-2.0",
"version": "1.14.0",
"version": "1.14.1",
"private": false,
"bugs": {
"url": "https://github.com/pschroeder89/homebridge-levoit-humidifiers/issues"
Expand Down
6 changes: 3 additions & 3 deletions src/api/VeSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class VeSync {

private readonly AXIOS_OPTIONS = {
baseURL: 'https://smartapi.vesync.com',
timeout: this.config.options.apiTimeout || 15000,
timeout: this.config.options?.apiTimeout || 15000,
};

constructor(
Expand Down Expand Up @@ -114,7 +114,7 @@ export default class VeSync {
this.log.error(
'VeSync cannot communicate with humidifier! Check the VeSync App.',
);
if (this.config.options.showOffWhenDisconnected) {
if (this.config.options?.showOffWhenDisconnected) {
return false;
} else {
throw new Error(
Expand Down Expand Up @@ -173,7 +173,7 @@ export default class VeSync {
this.log.error(
'VeSync cannot communicate with humidifier! Check the VeSync App.',
);
if (this.config.options.showOffWhenDisconnected) {
if (this.config.options?.showOffWhenDisconnected) {
return false;
} else {
throw new Error(
Expand Down

0 comments on commit 69cf69b

Please sign in to comment.