forked from Mirrors/flatpak-builder
xdg_app_installation_list_remote_refs_sync: Don't crash on weird refs
parent
cd2c5af974
commit
a1b5bb1507
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue