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
This commit is contained in:
malbx
2021-03-15 03:00:23 -04:00
committed by Alexander Larsson
parent 0a07d2122b
commit 0a9253f7d9

View File

@@ -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)