dir: Handle NULL sideload state in flatpak_remote_state_lookup_ref

Even on success, flatpak_remote_state_resolve_sideloaded_ref might
return a NULL FlatpakSideloadState. Handle it properly.
This commit is contained in:
Sebastian Wick
2025-08-28 11:15:37 +02:00
parent e069452d7c
commit bc5c8e65be

View File

@@ -827,12 +827,16 @@ flatpak_remote_state_lookup_ref (FlatpakRemoteState *self,
else
{
FlatpakSideloadState *ss = NULL;
g_autoptr(GFile) found_sideload_path = NULL;
if (!flatpak_remote_state_resolve_sideloaded_ref (self, ref, out_checksum, out_timestamp, out_info, &ss, error))
return FALSE;
if (ss)
found_sideload_path = g_object_ref (ostree_repo_get_path (ss->repo));
if (out_sideload_path)
*out_sideload_path = g_object_ref (ostree_repo_get_path (ss->repo));
*out_sideload_path = g_steal_pointer (&found_sideload_path);
}
return TRUE;