json: handle NULL explicitly in json_variant_has_type()

This commit is contained in:
Lennart Poettering 2019-01-04 13:24:18 +01:00
parent 6af022fedd
commit f8c186c9ec
1 changed files with 2 additions and 0 deletions

View File

@ -979,6 +979,8 @@ bool json_variant_has_type(JsonVariant *v, JsonVariantType type) {
JsonVariantType rt;
v = json_variant_dereference(v);
if (!v)
return false;
rt = json_variant_type(v);
if (rt == type)