Skip to content

Commit

Permalink
rulecache.py: skip empty metadata (#5148)
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikov-a authored Aug 8, 2021
1 parent 27fdfe4 commit 3f73088
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/opnsense/scripts/suricata/lib/rulecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def list_rules(self, filename):
if prop == 'metadata':
for mdtag in list(csv.reader([value], delimiter=","))[0]:
parts = mdtag.split(maxsplit=1)
record['metadata'][parts[0]] = parts[1] if len(parts) > 1 else None
if parts:
record['metadata'][parts[0]] = parts[1] if len(parts) > 1 else None
else:
record[prop] = value

Expand Down

0 comments on commit 3f73088

Please sign in to comment.