aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cJSON.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cJSON.c b/cJSON.c
index cac1164..483d0c0 100644
--- a/cJSON.c
+++ b/cJSON.c
@@ -2204,7 +2204,7 @@ CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * c
CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item)
{
- if ((parent == NULL) || (item == NULL))
+ if ((parent == NULL) || (parent->child == NULL) || (item == NULL) || (item->prev == NULL))
{
return NULL;
}