From 9843337e43a3d72866fbf232548291df3c569c7d Mon Sep 17 00:00:00 2001 From: Schimon Jehudah Date: Tue, 2 Jan 2024 18:45:43 +0000 Subject: [PATCH] Fix missing key error --- slixfeed/config.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/slixfeed/config.py b/slixfeed/config.py index 6b38be4..4bd3016 100644 --- a/slixfeed/config.py +++ b/slixfeed/config.py @@ -61,10 +61,19 @@ def get_value(filename, section, keys): if isinstance(keys, list): result = [] for key in keys: - result.extend([section_res[key]]) + try: + value = section_res[key] + except: + print("Missing key:", key) + value = '' + result.extend([value]) elif isinstance(keys, str): key = keys - result = section_res[key] + try: + result = section_res[key] + except: + print("Missing key:", key) + result = '' return result