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; return;
fake = _clutter_script_generate_fake_id (script); fake = _clutter_script_generate_fake_id (script);
json_object_set_string_member (object, "id", fake);
val = json_node_new (JSON_NODE_VALUE);
json_node_set_string (val, fake);
json_object_set_member (object, "id", val);
g_free (fake); g_free (fake);
} }
@ -1015,6 +1012,15 @@ clutter_script_parser_object_end (JsonParser *json_parser,
continue; continue;
node = json_object_get_member (object, name); 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); pinfo = g_slice_new (PropertyInfo);