diff --git a/cJSON_Utils.c b/cJSON_Utils.c index 8f99c2e..bd67201 100644 --- a/cJSON_Utils.c +++ b/cJSON_Utils.c @@ -279,16 +279,17 @@ static cJSON *get_item_from_pointer(cJSON * const object, const char * pointer, { current_element = current_element->next; } - /* skip to the next path token or end of string */ - while ((pointer[0] != '\0') && (pointer[0] != '/')) - { - pointer++; - } } else { return NULL; } + + /* skip to the next path token or end of string */ + while ((pointer[0] != '\0') && (pointer[0] != '/')) + { + pointer++; + } } return current_element;