From 6dbc097ac58c680c01db5cc5a7e0006dc6287ed0 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Tue, 22 Mar 2022 10:42:13 +0100 Subject: [PATCH] build-export: Avoid segfault if Exec line is missing from desktop file --- app/flatpak-builtins-build-export.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c index 2b7fadfd..0c1743ac 100644 --- a/app/flatpak-builtins-build-export.c +++ b/app/flatpak-builtins-build-export.c @@ -500,12 +500,14 @@ check_refs: g_print (_("WARNING: Can't find Exec key in %s: %s\n"), path, local_error->message); g_clear_error (&local_error); } + else + { + argv = g_strsplit (command, " ", 0); - argv = g_strsplit (command, " ", 0); - - bin_file = convert_app_absolute_path (argv[0], files); - if (!g_file_query_exists (bin_file, NULL)) - g_print (_("WARNING: Binary not found for Exec line in %s: %s\n"), path, command); + bin_file = convert_app_absolute_path (argv[0], files); + if (!g_file_query_exists (bin_file, NULL)) + g_print (_("WARNING: Binary not found for Exec line in %s: %s\n"), path, command); + } *icon = g_key_file_get_string (key_file, G_KEY_FILE_DESKTOP_GROUP,