mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-29 05:39:24 +01:00
json: add NULL check for container on get_container
In case the caller just wants to check an object is iterable, without actually iterating it.
This commit is contained in:
parent
380896d08a
commit
1f91c03bf6
@ -393,6 +393,7 @@ bool json_iter_get_container(struct json_iter *iter,
|
|||||||
if (t->type != JSMN_OBJECT && t->type != JSMN_ARRAY)
|
if (t->type != JSMN_OBJECT && t->type != JSMN_ARRAY)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (container)
|
||||||
iter_recurse(iter, t, container);
|
iter_recurse(iter, t, container);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user