Sometimes metadata ends up being empty for some reason and ends up being loaded as None, making the "in" operator crash :|

This commit is contained in:
Alexandre Aubin 2021-06-21 19:00:26 +02:00 committed by GitHub
parent 9bec81398a
commit 50129f3a29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -222,7 +222,7 @@ def log_show(
# Display metadata if exist
if os.path.exists(md_path):
try:
metadata = read_yaml(md_path)
metadata = read_yaml(md_path) or {}
except MoulinetteError as e:
error = m18n.n("log_corrupted_md_file", md_file=md_path, error=e)
if os.path.exists(log_path):