From 203847d03c551ea13f87a78e636e0a74dc13c5fb Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 18 Mar 2010 17:44:14 +0000 Subject: [PATCH] script: Skip empty nodes If we get an empty node then we should skip it; this is really a workaround for something that is broken in JSON-GLib or in our use of JSON-GLib. --- clutter/clutter-script-parser.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c index ce19549..4fed767 100644 --- a/clutter/clutter-script-parser.c +++ b/clutter/clutter-script-parser.c @@ -921,10 +921,7 @@ clutter_script_parser_object_end (JsonParser *json_parser, return; fake = _clutter_script_generate_fake_id (script); - - val = json_node_new (JSON_NODE_VALUE); - json_node_set_string (val, fake); - json_object_set_member (object, "id", val); + json_object_set_string_member (object, "id", fake); g_free (fake); } @@ -1015,6 +1012,15 @@ clutter_script_parser_object_end (JsonParser *json_parser, continue; node = json_object_get_member (object, name); + if (node == NULL) + { + CLUTTER_NOTE (SCRIPT, + "Empty node for member '%s' of object '%s' (type: %s)", + name, + oinfo->id, + oinfo->class_name); + continue; + } pinfo = g_slice_new (PropertyInfo); -- 2.7.4