diff options
author | Robert McQueen <rob@endlessm.com> | 2017-07-14 12:20:23 +0100 |
---|---|---|
committer | Robert McQueen <rob@endlessm.com> | 2017-07-14 12:21:32 +0100 |
commit | 230e18db7becd435a95b349228de7da3c9b39ca9 (patch) | |
tree | cbb8f2562ef41df39e3722ecfead30b4c6859309 /app/flatpak-builtins-info.c | |
parent | eecdcbd1951d9c36a3c7d312da880e7d2eaa7a40 (diff) | |
download | flatpak-230e18db7becd435a95b349228de7da3c9b39ca9.tar.gz |
fix crash in flatpak info when app is not present in origin
Diffstat (limited to 'app/flatpak-builtins-info.c')
-rw-r--r-- | app/flatpak-builtins-info.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/flatpak-builtins-info.c b/app/flatpak-builtins-info.c index 22368adb..bcc5ec8c 100644 --- a/app/flatpak-builtins-info.c +++ b/app/flatpak-builtins-info.c @@ -78,7 +78,6 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * g_autoptr(FlatpakDeploy) deploy = NULL; g_autoptr(GKeyFile) metakey = NULL; const char *commit = NULL; - const char *latest = NULL; const char *alt_id = NULL; const char *pref = NULL; const char *default_branch = NULL; @@ -141,7 +140,6 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * commit = flatpak_deploy_data_get_commit (deploy_data); alt_id = flatpak_deploy_data_get_alt_id (deploy_data); origin = flatpak_deploy_data_get_origin (deploy_data); - latest = flatpak_dir_read_latest (dir, origin, ref, NULL, NULL, NULL); size = flatpak_deploy_data_get_installed_size (deploy_data); formatted = g_format_size (size); path = g_file_get_path (flatpak_deploy_get_dir (deploy)); @@ -154,6 +152,10 @@ flatpak_builtin_info (int argc, char **argv, GCancellable *cancellable, GError * if (friendly) { + const char *latest = flatpak_dir_read_latest (dir, origin, ref, NULL, NULL, NULL); + if (latest == NULL) + latest = _("ref not present in origin"); + g_print ("%s%s%s %s\n", on, _("Ref:"), off, ref); g_print ("%s%s%s %s\n", on, _("ID:"), off, parts[1]); g_print ("%s%s%s %s\n", on, _("Arch:"), off, parts[2]); |