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.
This commit is contained in:
Emmanuele Bassi 2010-03-18 17:44:14 +00:00
parent d2bb57c3b2
commit 203847d03c

View File

@ -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);