diff --git a/cJSON.c b/cJSON.c index 1e9802a..15bd7f8 100644 --- a/cJSON.c +++ b/cJSON.c @@ -2008,7 +2008,7 @@ CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newi static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) { - if (replacement == NULL) + if ((replacement == NULL) || (string == NULL)) { return false; }