From 3efd92c5f85f2b79753b5c2469eff69729bd6145 Mon Sep 17 00:00:00 2001 From: rosstripi Date: Thu, 18 May 2023 15:54:56 -0400 Subject: [PATCH] Handled null profile edit date. Was getting this error when trying to search an email without any "last edited date" on the profile: print(f"Last profile edit : {target.sourceIds[container].lastUpdated.strftime('%Y/%m/%d %H:%M:%S (UTC)')}\n") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'strftime' --- ghunt/modules/email.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ghunt/modules/email.py b/ghunt/modules/email.py index ab7b7e5f..1d2376a2 100644 --- a/ghunt/modules/email.py +++ b/ghunt/modules/email.py @@ -72,7 +72,8 @@ async def hunt(as_client: httpx.AsyncClient, email_address: str, json_file: bool await ia.detect_face(vision_api, as_client, target.coverPhotos[container].url) print() - print(f"Last profile edit : {target.sourceIds[container].lastUpdated.strftime('%Y/%m/%d %H:%M:%S (UTC)')}\n") + if target.sourceIds[container].lastUpdated is not None: + print(f"Last profile edit : {target.sourceIds[container].lastUpdated.strftime('%Y/%m/%d %H:%M:%S (UTC)')}\n") if container in target.emails: print(f"Email : {target.emails[container].value}")