From a38ee63e5147f4b446478ddeef774370b17b2daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Achim=20K=C3=B6nigs?= Date: Thu, 21 May 2020 00:53:05 +0200 Subject: [PATCH] fixed possible crash on start --- README.md | 1 + main.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e69ec4..f3a919e 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,7 @@ Or install from admin webpage. --> ### __WORK IN PROGRESS__ * added 'preventUnnamedDevices' option ot prevent creation of devices that do not report their name. This sometimes happens if devices are talking on CEC bus but are not switched on (depends on device type). +* fixed possible crash on start ### 0.0.2 (2020-01-28) * fixed a lot of bugs diff --git a/main.js b/main.js index 5183e24..f3dc271 100644 --- a/main.js +++ b/main.js @@ -809,7 +809,7 @@ class CEC2 extends utils.Adapter { /** @type {stateDefinition} */ const def = stateDefinitions[defString]; const state = await this.getStateAsync(stateObject._id); - if (state) { //unpack val + if (state && !def.readOnly) { //unpack val existingDevice[def.key || def.name] = state.val; //remember values } existingDevice.createdStates.push(defString);