utils: Don't pass NULL remote to ostree_repo_get_remote_option

Fixes: #4662
(cherry picked from commit dd2a04f978596e1cadb2d862530ba4fe9acf0530)
This commit is contained in:
taoky 2025-01-14 02:08:50 +08:00 committed by bbhtt
parent c3c611ce19
commit 228dfab479

View File

@ -3857,8 +3857,8 @@ flatpak_pull_from_bundle (OstreeRepo *repo,
if (metadata_contents != NULL)
metadata_size = strlen (metadata_contents);
if (!ostree_repo_get_remote_option (repo, remote, "collection-id", NULL,
&remote_collection_id, NULL))
if (!remote || !ostree_repo_get_remote_option (repo, remote, "collection-id", NULL,
&remote_collection_id, NULL))
remote_collection_id = NULL;
if (remote_collection_id != NULL && collection_id != NULL &&