From 415fce33c85812131b315d120246264764a792a2 Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Sun, 10 Feb 2019 00:18:48 +0300 Subject: [PATCH] hungs if no items configured - fixed --- lighthub/item.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 4bfd5f8..42d88bb 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -85,15 +85,14 @@ void Item::Parse() { itemArg = aJson.getArrayItem(itemArr, I_ARG); itemVal = aJson.getArrayItem(itemArr, I_VAL); // debugSerial << F(" Item:") << itemArr->name << F(" T:") << itemType << F(" =") << getArg() << endl; - } +} } Item::Item(char *name) //Constructor { - if (name) + if (name && items) itemArr = aJson.getObjectItem(items, name); else itemArr = NULL; - Parse(); }