From 4c658b8d992b43fbb003af2f2f5b428a45a8fe12 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Fri, 24 Nov 2023 09:04:42 -0800 Subject: [PATCH] mqtt: default to empty args --- plugins/mqtt/package-lock.json | 4 ++-- plugins/mqtt/package.json | 2 +- plugins/mqtt/src/main.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mqtt/package-lock.json b/plugins/mqtt/package-lock.json index bd25297e7..72d334a79 100644 --- a/plugins/mqtt/package-lock.json +++ b/plugins/mqtt/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/mqtt", - "version": "0.0.69", + "version": "0.0.71", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/mqtt", - "version": "0.0.69", + "version": "0.0.71", "dependencies": { "@types/node": "^16.6.1", "aedes": "^0.46.1", diff --git a/plugins/mqtt/package.json b/plugins/mqtt/package.json index afaba6101..5b680fe79 100644 --- a/plugins/mqtt/package.json +++ b/plugins/mqtt/package.json @@ -41,5 +41,5 @@ "@scrypted/common": "file:../../common", "@types/nunjucks": "^3.2.0" }, - "version": "0.0.69" + "version": "0.0.71" } diff --git a/plugins/mqtt/src/main.ts b/plugins/mqtt/src/main.ts index 31bf2d77c..9d88ff300 100644 --- a/plugins/mqtt/src/main.ts +++ b/plugins/mqtt/src/main.ts @@ -298,7 +298,7 @@ class MqttPublisherMixin extends SettingsMixinDeviceBase { return; } try { - const args = JSON.parse(message.toString()); + const args = JSON.parse(message.toString() || '[]'); await this.device[method](...args); } catch (e) {