fix: do not crash on empty malicious file

pull/86/head
Raphaël Vinot 2020-09-01 18:39:49 +02:00
parent 370fda48e2
commit 6d22085ceb
1 changed files with 2 additions and 2 deletions

View File

@ -191,9 +191,9 @@ class Context():
# User defined as malicious
for h, details in file_content.items():
p.sadd('bh|malicious', h)
if 'target' in details:
if 'target' in details and details['target']:
p.sadd(f'{h}|target', *details['target'])
if 'tag' in details:
if 'tag' in details and details['tag']:
p.sadd(f'{h}|tag', *details['tag'])
elif filename == 'legitimate':
# User defined as legitimate