fix: Do not fail on MISP export if there are no redirects

pull/145/head
Raphaël Vinot 2020-12-24 15:43:44 +01:00
parent 3b8b3faff4
commit 7241ae2ea1
1 changed files with 6 additions and 5 deletions

View File

@ -924,6 +924,7 @@ class Lookyloo():
initial_url = URLObject(cache["url"]) # type: ignore initial_url = URLObject(cache["url"]) # type: ignore
redirects = [URLObject(url) for url in cache['redirects']] # type: ignore redirects = [URLObject(url) for url in cache['redirects']] # type: ignore
if redirects:
initial_url.add_reference(redirects[0], 'redirects-to') initial_url.add_reference(redirects[0], 'redirects-to')
prec_object = redirects[0] prec_object = redirects[0]
for u_object in redirects[1:]: for u_object in redirects[1:]: