Avoid an AttributeError if no session is used for a module

This commit is contained in:
Lucas Verney 2016-09-30 05:30:38 +02:00
parent 48482947c2
commit 12401f616b

View File

@ -120,9 +120,13 @@ def main(used_modules):
logging.error("%s capability is not implemented.", capability) logging.error("%s capability is not implemented.", capability)
continue continue
# Store session cookie of this module, to fetch files afterwards # Store session cookie of this module, to fetch files afterwards
fetched_data[module["id"]]["cookies"] = dict_from_cookiejar( try:
backend.browser.session.cookies fetched_data[module["id"]]["cookies"] = dict_from_cookiejar(
) backend.browser.session.cookies
)
except AttributeError:
# Avoid an AttributeError if no session is used for this module
fetched_data[module["id"]]["cookies"] = None
logging.info("Done fetching from konnectors.") logging.info("Done fetching from konnectors.")
return fetched_data return fetched_data