From 8c73680ad367b7539241b2223c90bf68a308920b Mon Sep 17 00:00:00 2001 From: Harrison Goscenski Date: Tue, 13 Feb 2024 13:08:29 -0600 Subject: [PATCH] Updating to handle case with missing code --- package.json | 2 +- src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5e58556..af7fbda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wyze-api", - "version": "1.1.4", + "version": "1.1.5", "description": "An unoficial API wrapper for Wyze products.", "homepage": "https://github.com/jfarmer08/wyze-api", "main": "./src/index.js", diff --git a/src/index.js b/src/index.js index 722b0f1..7fc2fec 100644 --- a/src/index.js +++ b/src/index.js @@ -145,7 +145,7 @@ module.exports = class WyzeAPI { throw e; } - if (result.data.code != 1) { + if (result.data.code && result.data.code != 1) { this.log.debug(`Potentially recoverable error during request, '${result.data.msg}'`) throw new Error("Potentially recoverable error during request"); }