summaryrefslogtreecommitdiffstats
path: root/qobject
diff options
context:
space:
mode:
Diffstat (limited to 'qobject')
-rw-r--r--qobject/json-streamer.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c
index 810aae521f..954bf9d468 100644
--- a/qobject/json-streamer.c
+++ b/qobject/json-streamer.c
@@ -99,16 +99,13 @@ void json_message_process_token(JSONLexer *lexer, GString *input,
g_queue_push_tail(parser->tokens, token);
- if (parser->brace_count < 0 ||
- parser->bracket_count < 0 ||
- (parser->brace_count == 0 &&
- parser->bracket_count == 0)) {
- json = json_parser_parse(parser->tokens, parser->ap, &err);
- parser->tokens = NULL;
- goto out_emit;
+ if ((parser->brace_count > 0 || parser->bracket_count > 0)
+ && parser->bracket_count >= 0 && parser->bracket_count >= 0) {
+ return;
}
- return;
+ json = json_parser_parse(parser->tokens, parser->ap, &err);
+ parser->tokens = NULL;
out_emit:
parser->brace_count = 0;