fix: Skip urlhaus module if no reports

pull/558/head
Raphaël Vinot 2022-12-05 18:22:47 +01:00
parent b1c0835463
commit 6871c36848
2 changed files with 5 additions and 2 deletions

View File

@ -76,7 +76,9 @@ class URLhaus():
return return
url_information = self.__url_result(url) url_information = self.__url_result(url)
if not url_information: if (not url_information
or ('query_status' in url_information
and url_information['query_status'] == 'no_results')):
url_storage_dir.rmdir() url_storage_dir.rmdir()
return return

View File

@ -447,7 +447,8 @@ def modules(tree_uuid: str):
# TODO: make a short result # TODO: make a short result
uh = modules_responses.pop('urlhaus') uh = modules_responses.pop('urlhaus')
for url, results in uh['urls'].items(): for url, results in uh['urls'].items():
urlhaus_short_result['urls'].append(results) if results:
urlhaus_short_result['urls'].append(results)
urlscan_to_display: Dict = {} urlscan_to_display: Dict = {}
if 'urlscan' in modules_responses and modules_responses.get('urlscan'): if 'urlscan' in modules_responses and modules_responses.get('urlscan'):