path = g_build_filename (dirname, filename, NULL);
component = ibus_component_new_from_file (path);
- registry->components = g_list_append (registry->components, component);
+ if (component != NULL) {
+ g_object_ref_sink (component);
+ registry->components = g_list_append (registry->components, component);
+ }
g_free (path);
}
#define OUTPUT_ENTRY(field, element) \
{ \
- gchar *escape_text = g_markup_escape_text (component->field, -1); \
+ gchar *escape_text = \
+ g_markup_escape_text (component->field ? \
+ component->field : "", -1); \
g_string_append_indent (output, indent + 1); \
g_string_append_printf (output, "<"element">%s</"element">\n", \
escape_text); \