mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2026-04-29 02:24:09 +02:00
Fixed null pointer exception in JsonArray and JsonHashTable constructors
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@
|
||||
JsonArray::JsonArray(char* json, jsmntok_t* tokens)
|
||||
: JsonObjectBase(json, tokens)
|
||||
{
|
||||
if (tokens[0].type != JSMN_ARRAY)
|
||||
if (tokens == 0 || tokens[0].type != JSMN_ARRAY)
|
||||
makeInvalid();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
JsonHashTable::JsonHashTable(char* json, jsmntok_t* tokens)
|
||||
: JsonObjectBase(json, tokens)
|
||||
{
|
||||
if (tokens[0].type != JSMN_OBJECT)
|
||||
if (tokens == 0 || tokens[0].type != JSMN_OBJECT)
|
||||
makeInvalid();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user