mirror of
https://github.com/opnsense/plugins.git
synced 2026-05-28 04:34:15 -04:00
security/q-feeds-connector: ignore invalid json index file leading to instant exit of qfeedsctl.py
This commit is contained in:
parent
7b3b5a4e3c
commit
b9084be77b
1 changed files with 4 additions and 1 deletions
|
|
@ -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'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue