From 7a3fad5a92e6af516cdac4064ad092ce714a0d52 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Sun, 23 Aug 2020 14:57:19 +0200 Subject: [PATCH] Keep 'null' attributes --- tasmota/xdrv_23_zigbee_2_devices.ino | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_2_devices.ino b/tasmota/xdrv_23_zigbee_2_devices.ino index 9bdd512d3..a7bd2adee 100644 --- a/tasmota/xdrv_23_zigbee_2_devices.ino +++ b/tasmota/xdrv_23_zigbee_2_devices.ino @@ -818,8 +818,8 @@ void CopyJsonVariant(JsonObject &to, const String &key, const JsonVariant &val) to.remove(key); // force remove to have metadata like LinkQuality at the end if (val.is()) { - String sval = val.as(); // force a copy of the String value, avoiding crash - to.set(key, sval); + const char * sval = val.as(); // using char* forces a copy, and also captures 'null' values + to.set(key, (char*) sval); } else if (val.is()) { JsonArray &nested_arr = to.createNestedArray(key); CopyJsonArray(nested_arr, val.as()); // deep copy