int component_plugin_parser_handler_install(const char *package, xmlDocPtr doc)
{
GList *list = NULL;
+ GList *tmp = NULL;
const char *name;
xmlNode *root;
xmlNode *node;
if (strcmp(name, "component-based-application") != 0)
continue;
- ret = __parse_component_based_application(package, node, &list);
+ ret = __parse_component_based_application(package, node, &tmp);
if (ret < 0) {
LOGE("Failed to parse component-based-application");
g_list_free_full(list, __destroy_component);
return -1;
}
+
+ if (!tmp) {
+ LOGE("Component info is empty");
+ g_list_free_full(list, __destroy_component);
+ return -1;
+ }
+
+ __fill_extra_info(tmp);
+ list = g_list_concat(list, tmp);
+ tmp = NULL;
}
if (!list) {
return -1;
}
- __fill_extra_info(g_list_first(list));
- ret = __insert_component_info(g_list_first(list));
+ ret = __insert_component_info(list);
g_list_free_full(list, __destroy_component);
return ret;