From 0a9253f7d946590eea82e45be268f3e0b2fba136 Mon Sep 17 00:00:00 2001 From: malbx Date: Mon, 15 Mar 2021 03:00:23 -0400 Subject: [PATCH] history: Handle transaction log entry with empty REF field This checks that the value of the REF field is not an empty string before calling `flatpak_decomposed_new_from_ref`. Attempting to decompose an empty string leads to a validation error and prevents any history from being printed. Fixes https://github.com/flatpak/flatpak/issues/4121 --- app/flatpak-builtins-history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/flatpak-builtins-history.c b/app/flatpak-builtins-history.c index 49ba931f..5b5df2bf 100644 --- a/app/flatpak-builtins-history.c +++ b/app/flatpak-builtins-history.c @@ -222,7 +222,7 @@ print_history (GPtrArray *dirs, if (*error) return FALSE; - if (ref_str) + if (ref_str && ref_str[0]) { ref = flatpak_decomposed_new_from_ref (ref_str, error); if (ref == NULL)