Closed
Description
Hello,
what's the best way to check if a json property exists or has value ? i was trying to make the condition jDoc["relayInterval"]!=NULL but it's not working.
`
File configFile = SPIFFS.open("/configsa.json", "r");
size_t size = configFile.size();
// Allocate a buffer to store contents of the file.
std::unique_ptr<char[]> buf(new char[size]);
configFile.readBytes(buf.get(), size);
DynamicJsonDocument jDoc(2500);
DeserializationError error = deserializeJson(jDoc,buf.get());
if (!error)
{
if(jDoc["relayInterval"]!=NULL)
strcpy(relay_interval,jDoc["relayInterval"]);
}
'