fix: Avoid exception when there is no URL to send to VT

pull/815/head
Raphaël Vinot 2023-10-21 16:59:17 +02:00
parent db9ca0ea2b
commit a6fff6687d
1 changed files with 2 additions and 0 deletions

View File

@ -1098,6 +1098,8 @@ class Lookyloo():
def __misp_add_vt_to_URLObject(self, obj: MISPObject) -> Optional[MISPObject]:
urls = obj.get_attributes_by_relation('url')
if not urls:
return None
url = urls[0]
self.vt.url_lookup(url.value)
report = self.vt.get_url_lookup(url.value)