From 9730df7adce9526d078a11545eeddec81ef5bfbf Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 8 Jan 2019 14:22:45 +0100 Subject: [PATCH] Fix exception 28 in display driver --- sonoff/xdrv_13_display.ino | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sonoff/xdrv_13_display.ino b/sonoff/xdrv_13_display.ino index a3034bca2..fe9805af6 100644 --- a/sonoff/xdrv_13_display.ino +++ b/sonoff/xdrv_13_display.ino @@ -785,14 +785,20 @@ void DisplayAnalyzeJson(char *topic, char *json) if (value2.is()) { JsonObject& Object3 = value2; for (JsonObject::iterator it3 = Object3.begin(); it3 != Object3.end(); ++it3) { - DisplayJsonValue(topic, it->key, it3->key, it3->value.as()); // Sensor 56% + if (it3->value != NULL) { // "DHT11":{"Temperature":null,"Humidity":null} - ignore as it will raise exception 28 + DisplayJsonValue(topic, it->key, it3->key, it3->value.as()); // Sensor 56% + } } } else { - DisplayJsonValue(topic, it->key, it2->key, it2->value.as()); // Sensor 56% + if (it2->value != NULL) { // "DHT11":{"Temperature":null,"Humidity":null} - ignore as it will raise exception 28 + DisplayJsonValue(topic, it->key, it2->key, it2->value.as()); // Sensor 56% + } } } } else { - DisplayJsonValue(topic, it->key, it->key, it->value.as()); // Topic 56% + if (it->value != NULL) { // "DHT11":{"Temperature":null,"Humidity":null} - ignore as it will raise exception 28 + DisplayJsonValue(topic, it->key, it->key, it->value.as()); // Topic 56% + } } } }