summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanilo Bargen <mail@dbrgn.ch>2022-03-22 10:42:13 +0100
committerAlexander Larsson <alexander.larsson@gmail.com>2022-08-16 10:42:06 +0200
commit6dbc097ac58c680c01db5cc5a7e0006dc6287ed0 (patch)
tree76fbdc9d761174e963631ac1b590a8f1ffd43074
parent53a0b528bf41af7c54818dfad9c6028e78425acf (diff)
downloadflatpak-6dbc097ac58c680c01db5cc5a7e0006dc6287ed0.tar.gz
build-export: Avoid segfault if Exec line is missing from desktop file
-rw-r--r--app/flatpak-builtins-build-export.c12
1 files 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,