xdg_app_installation_list_remote_refs_sync: Don't crash on weird refs

This commit is contained in:
Alexander Larsson committed 2016-01-15 14:53:34 +01:00
1 parent cd2c5af974
commit a1b5bb1507
2 files changed
+8 -3

No files matched your search

+5 -2
View File
@@ -1052,9 +1052,12 @@ xdg_app_installation_list_remote_refs_sync (XdgAppInstallation *self,
{
const char *refspec = key;
const char *checksum = value;
XdgAppRemoteRef *ref;
g_ptr_array_add (refs,
xdg_app_remote_ref_new (refspec, checksum, remote_name));
ref = xdg_app_remote_ref_new (refspec, checksum, remote_name);
if (ref)
g_ptr_array_add (refs, ref);
}
return g_steal_pointer (&refs);
+3 -1
View File
@@ -137,7 +137,9 @@ xdg_app_remote_ref_new (const char *full_ref,
g_auto(GStrv) parts = NULL;
XdgAppRemoteRef *ref;
parts = g_strsplit (full_ref, "/", -1);
parts = xdg_app_decompose_ref (full_ref, NULL);
if (parts == NULL)
return NULL;
if (strcmp (parts[0], "app") != 0)
kind = XDG_APP_REF_KIND_RUNTIME;