This commit is contained in:
iceman1001 2019-04-25 17:06:40 +02:00
commit df96b58fcc
3 changed files with 11 additions and 6 deletions

View file

@ -480,9 +480,14 @@ static int unpack_object(scanner_t *s, json_t *root, va_list *ap) {
return -1; return -1;
} }
if (root && !json_is_object(root)) { if (root && !json_is_object(root)) {
set_error(s, "<validation>", json_error_wrong_type, "Expected object, got %s", set_error(s,
type_name(root)); "<validation>",
json_error_wrong_type,
"Expected object, got %s",
(root) ? type_name(root) : "NULL"
);
goto out; goto out;
} }
next_token(s); next_token(s);