repair: Don't crash if no remotes are configured

If no remotes are configured, ostree_repo_remote_list returns NULL
so don't dereference it.

Fixes: https://github.com/flatpak/flatpak/issues/3436
This commit is contained in:
Alexander Larsson
2020-03-16 10:47:41 +01:00
parent b79e878a75
commit e2ee3306b7

View File

@@ -15140,7 +15140,7 @@ flatpak_dir_delete_mirror_refs (FlatpakDir *self,
* OS updates which Flatpak shouldn't touch.
*/
remotes = ostree_repo_remote_list (repo, NULL);
for (i = 0; remotes[i] != NULL; i++)
for (i = 0; remotes != NULL && remotes[i] != NULL; i++)
{
g_autofree char *remote_collection_id = NULL;