fix: avoid exception if submission is missing

pull/247/head
Raphaël Vinot 2021-08-13 16:24:34 +02:00
parent 50dbbd6eba
commit 9ff2bf8157
1 changed files with 1 additions and 1 deletions

View File

@ -396,7 +396,7 @@ def modules(tree_uuid: str):
if 'urlscan' in modules_responses:
urlscan = modules_responses.pop('urlscan')
urlscan_to_display = {'permaurl': '', 'malicious': False, 'tags': []}
if urlscan['submission'].get('result'):
if urlscan['submission'] and urlscan['submission'].get('result'):
urlscan_to_display['permaurl'] = urlscan['submission']['result']
if urlscan['result']:
# We have a result available, get the verdicts