Merge pull request #38 from fireeye/ana-fix-keyerror

Fix KeyError when deleting nonexistent keys
This commit is contained in:
Willi Ballenthin
2020-06-30 15:21:12 -06:00
committed by GitHub

View File

@@ -590,10 +590,11 @@ class Rule(object):
# save off the existing hidden meta values,
# emit the document,
# and re-add the hidden meta.
hidden_meta = {
key: meta.get(key)
for key in HIDDEN_META_KEYS
}
hidden_meta = {}
for key in HIDDEN_META_KEYS:
value = meta.get(key)
if value:
hidden_meta[key] = value
for key in hidden_meta.keys():
del meta[key]