diff --git a/cJSON.c b/cJSON.c index 56cc85b24d39d925b0348632fb8804885b60abb8..62d7bf23ea212e57f5da73898e310400bfc56f07 100644 --- a/cJSON.c +++ b/cJSON.c @@ -256,6 +256,7 @@ static const char *parse_value(cJSON *item,const char *value) // Render a value to text. static char *print_value(cJSON *item,int depth,int fmt) { + if (!item) return 0; char *out=0; switch ((item->type)&255) {