summaryrefslogtreecommitdiff
path: root/qobject
diff options
context:
space:
mode:
Diffstat (limited to 'qobject')
-rw-r--r--qobject/qjson.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/qobject/qjson.c b/qobject/qjson.c
index 7f69036487..b9ccae2c2a 100644
--- a/qobject/qjson.c
+++ b/qobject/qjson.c
@@ -70,6 +70,10 @@ static QObject *qobject_from_jsonv(const char *string, va_list *ap,
json_message_parser_flush(&state.parser);
json_message_parser_destroy(&state.parser);
+ if (!state.result && !state.err) {
+ error_setg(&state.err, "Expecting a JSON value");
+ }
+
error_propagate(errp, state.err);
return state.result;
}