From 1403d176ebe9bd96b1dc8a0637d5ed2411f0d6ed Mon Sep 17 00:00:00 2001 From: ranlo Date: Wed, 18 Oct 2023 22:55:17 +0300 Subject: [PATCH] Update email.py added check for null lastUpdated to prevent crashes --- ghunt/modules/email.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ghunt/modules/email.py b/ghunt/modules/email.py index ab7b7e5f..a07d8fd9 100644 --- a/ghunt/modules/email.py +++ b/ghunt/modules/email.py @@ -72,7 +72,10 @@ 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: + print(f"Last profile edit : {target.sourceIds[container].lastUpdated.strftime('%Y/%m/%d %H:%M:%S (UTC)')}\n") + else: + gb.rc.print(f"Last profile edit : [italic]Not found.[/italic]\n") if container in target.emails: print(f"Email : {target.emails[container].value}") @@ -166,4 +169,4 @@ async def hunt(as_client: httpx.AsyncClient, email_address: str, json_file: bool f.write(json.dumps(json_results, cls=GHuntEncoder, indent=4)) gb.rc.print(f"\n[+] JSON output wrote to {json_file} !", style="italic") - await as_client.aclose() \ No newline at end of file + await as_client.aclose()