Fix KeyError when metadata.container is missing in People parser#593
Fix KeyError when metadata.container is missing in People parser#593SS-4 wants to merge 1 commit into
Conversation
…tainer is missing in People parser Fixes crash caused by missing "metadata.container" in Google responses. Replaced unsafe dictionary access with safe .get() checks across people.py. Prevents KeyError and allows parsing to continue when fields are missing.
|
Note: I replaced multiple unsafe accesses in one pass because the same issue occurs in several places (emails, names, photos, etc.). Happy to reduce this to minimal changes if preferred. |
|
I tested this locally on GHunt 2.3.4 and it fixes the The crash happens after authentication succeeds, inside the People API parser. The issue seems to be that Google People API can omit One important detail: this does not appear to be limited to The defensive Validation:
I am intentionally not including the tested email address, Google account, credentials path, tokens, cookies, session data, or OSINT results. Happy to help test further if useful. |
|
Small follow-up after local testing on GHunt 2.3.4. The Once that blocker is fixed, a separate issue becomes visible when running the same lookup with
This happens later in A minimal local fix that worked for me was to change the Maps export block in I think
That distinction matters for OSINT output quality. Using an empty list could incorrectly imply that GHunt verified there were no photos or reviews, when this path only appears to collect the Maps statistics. I would treat this as a separate JSON export issue. The |
Problem
GHunt crashes with:
KeyError: 'container'
This happens because Google responses sometimes omit "metadata.container".
Fix
Replaced unsafe dictionary access:
data["metadata"]["container"]
with safe access:
data.get("metadata", {}).get("container")
Result
Tested locally — resolves crash across multiple emails.