forked from bblanchon/ArduinoJson
Changed as<bool>() to return true for any non-null value (closes #1005)
This commit is contained in:
1 parent
fcbec6eb6d
commit
ed18e77655
3 files changed
+21
-14
No files matched your search
@@ -40,11 +40,10 @@ inline bool VariantData::asBoolean() const {
|
||||
return _content.asInteger != 0;
|
||||
case VALUE_IS_FLOAT:
|
||||
return _content.asFloat != 0;
|
||||
case VALUE_IS_LINKED_STRING:
|
||||
case VALUE_IS_OWNED_STRING:
|
||||
return strcmp("true", _content.asString) == 0;
|
||||
default:
|
||||
case VALUE_IS_NULL:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user