Commit 14dd7f82 authored by Christian Hergert's avatar Christian Hergert

flatpak: handle NULL installation gracefully

This can happen at start-up. We can just return an empty array
since the reload signal will cause things to reset.
parent 78b39f2c
......@@ -379,14 +379,18 @@ gbp_flatpak_application_addin_get_installations (GbpFlatpakApplicationAddin *sel
ret = g_ptr_array_new_with_free_func (g_object_unref);
for (guint i = 0; i < self->installations->len; i++)
/* Might be NULL before things have loaded at startup */
if (self->installations != NULL)
{
InstallInfo *info = g_ptr_array_index (self->installations, i);
for (guint i = 0; i < self->installations->len; i++)
{
InstallInfo *info = g_ptr_array_index (self->installations, i);
g_assert (info != NULL);
g_assert (FLATPAK_IS_INSTALLATION (info->installation));
g_assert (info != NULL);
g_assert (FLATPAK_IS_INSTALLATION (info->installation));
g_ptr_array_add (ret, g_object_ref (info->installation));
g_ptr_array_add (ret, g_object_ref (info->installation));
}
}
IDE_RETURN (ret);
......
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