summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhaedrus Leeds <mwleeds@endlessos.org>2021-01-20 15:39:30 -0800
committerGitHub <noreply@github.com>2021-01-20 15:39:30 -0800
commit06869af68a3efb09ca6d5d71c90652d15c055753 (patch)
tree3f6aa86bd392213efd018045108e3884f5f5ec32
parentb8d8e5bf043476364f496170b46695a7a42c7e57 (diff)
parent8f24958d2a00a746001157f44419d3f3c79426b9 (diff)
downloadflatpak-06869af68a3efb09ca6d5d71c90652d15c055753.tar.gz
Merge pull request #4085 from pwithnall/null-subpaths
flatpak-dir: Fix crash on updating app with no deploy data or subpaths
-rw-r--r--common/flatpak-dir.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 9f749b73..a2a18dc3 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -2078,6 +2078,8 @@ flatpak_dir_system_helper_call_deploy (FlatpakDir *self,
{
const char *empty[] = { NULL };
+ if (arg_subpaths == NULL)
+ arg_subpaths = empty;
if (arg_previous_ids == NULL)
arg_previous_ids = empty;
@@ -9684,6 +9686,7 @@ flatpak_dir_update (FlatpakDir *self,
{
g_autoptr(GBytes) deploy_data = NULL;
const char **subpaths = NULL;
+ const char *empty_subpaths[] = {NULL};
g_autofree char *url = NULL;
FlatpakPullFlags flatpak_flags;
g_autofree const char **old_subpaths = NULL;
@@ -9706,8 +9709,10 @@ flatpak_dir_update (FlatpakDir *self,
if (opt_subpaths)
subpaths = opt_subpaths;
- else
+ else if (old_subpaths)
subpaths = old_subpaths;
+ else
+ subpaths = empty_subpaths;
if (!ostree_repo_remote_get_url (self->repo, state->remote_name, &url, error))
return FALSE;