forked from Mirrors/flatpak-builder
common/dir: Handle NULL out parameter correctly when getting config
ostree_repo_get_remote_option() requires the out parameter to be non-NULL. Signed-off-by: Philip Withnall <withnall@endlessm.com>tingping/wmclass
parent
bc0f90764e
commit
358e204fb3
|
@ -1867,11 +1867,14 @@ repo_get_remote_collection_id (OstreeRepo *repo,
|
|||
GError **error)
|
||||
{
|
||||
#ifdef FLATPAK_ENABLE_P2P
|
||||
if (!ostree_repo_get_remote_option (repo, remote_name, "collection-id",
|
||||
NULL, collection_id_out, error))
|
||||
return FALSE;
|
||||
if (collection_id_out != NULL && *collection_id_out != NULL && **collection_id_out == '\0')
|
||||
g_clear_pointer (collection_id_out, g_free);
|
||||
if (collection_id_out != NULL)
|
||||
{
|
||||
if (!ostree_repo_get_remote_option (repo, remote_name, "collection-id",
|
||||
NULL, collection_id_out, error))
|
||||
return FALSE;
|
||||
if (*collection_id_out != NULL && **collection_id_out == '\0')
|
||||
g_clear_pointer (collection_id_out, g_free);
|
||||
}
|
||||
#else /* if !FLATPAK_ENABLE_P2P */
|
||||
if (collection_id_out != NULL)
|
||||
*collection_id_out = NULL;
|
||||
|
|
Loading…
Reference in New Issue