Skip to content

Commit 0eaa5e3

Browse files
committed
Fixed null pointer exception in JsonArray and JsonHashTable constructors
1 parent b35095d commit 0eaa5e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

JsonArray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
JsonArray::JsonArray(char* json, jsmntok_t* tokens)
1010
: JsonObjectBase(json, tokens)
1111
{
12-
if (tokens[0].type != JSMN_ARRAY)
12+
if (tokens == 0 || tokens[0].type != JSMN_ARRAY)
1313
makeInvalid();
1414
}
1515

JsonHashTable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
JsonHashTable::JsonHashTable(char* json, jsmntok_t* tokens)
1212
: JsonObjectBase(json, tokens)
1313
{
14-
if (tokens[0].type != JSMN_OBJECT)
14+
if (tokens == 0 || tokens[0].type != JSMN_OBJECT)
1515
makeInvalid();
1616
}
1717

0 commit comments

Comments
 (0)