security/q-feeds-connector: ignore invalid json index file leading to instant exit of qfeedsctl.py

This commit is contained in:
Ad Schellevis 2026-05-04 18:20:26 +02:00
parent 7b3b5a4e3c
commit b9084be77b

View file

@ -63,7 +63,10 @@ class QFeedsActions:
list(self.fetch_index())
elif not os.path.exists(self.index_file):
return {}
data = ujson.load(open(self.index_file)) or {}
try:
data = ujson.load(open(self.index_file)) or {}
except ujson.JSONDecodeError:
data = {}
if type(data) is dict:
for feed in data.get('feeds', []):
feed['local_filename'] = "%s/%s.txt" % (self._target_dir, feed['feed_type'])