Commit b990ed2c authored by Florian Müllner's avatar Florian Müllner
Browse files

app-system: Don't assume that gmenu_tree_load_sync() sets error

The function may return FALSE without setting the GError, so don't
assume it is set to prevent a crash in that case. While at it, free
the GError we were leaking before.

https://bugzilla.gnome.org/show_bug.cgi?id=670418
parent 097e56f4
......@@ -320,7 +320,15 @@ on_apps_tree_changed_cb (GMenuTree *tree,
if (!gmenu_tree_load_sync (self->priv->apps_tree, &error))
{
g_warning ("Failed to load apps: %s", error->message);
if (error)
{
g_warning ("Failed to load apps: %s", error->message);
g_error_free (error);
}
else
{
g_warning ("Failed to load apps");
}
return;
}
......@@ -411,7 +419,15 @@ on_settings_tree_changed_cb (GMenuTree *tree,
g_hash_table_remove_all (self->priv->setting_id_to_app);
if (!gmenu_tree_load_sync (self->priv->settings_tree, &error))
{
g_warning ("Failed to load settings: %s", error->message);
if (error)
{
g_warning ("Failed to load apps: %s", error->message);
g_error_free (error);
}
else
{
g_warning ("Failed to load apps");
}
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment