From f9143d531f3623726e8cc364aa5ac366188d5300 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 18 Dec 2020 17:53:05 +0100 Subject: [PATCH] Fix a small issue where metadata could be None (because of empty yaml maybe?) --- src/yunohost/log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/yunohost/log.py b/src/yunohost/log.py index 11b9034c6..cf108b989 100644 --- a/src/yunohost/log.py +++ b/src/yunohost/log.py @@ -89,14 +89,14 @@ def log_list(limit=None, with_details=False, with_suboperations=False): pass try: - metadata = read_yaml(md_path) + metadata = read_yaml(md_path) or {} # Making sure this is a dict and not None..? except Exception as e: # If we can't read the yaml for some reason, report an error and ignore this entry... logger.error(m18n.n('log_corrupted_md_file', md_file=md_path, error=e)) continue if with_details: - entry["success"] = metadata.get("success", "?") if metadata else "?" + entry["success"] = metadata.get("success", "?") entry["parent"] = metadata.get("parent") if with_suboperations: