Skip to content

fix: guard against None platform in get_exif sequence download#90

Open
chrisdebian wants to merge 1 commit into
mapilio:mainfrom
chrisdebian:fix/platform-none-and-raw-configparser
Open

fix: guard against None platform in get_exif sequence download#90
chrisdebian wants to merge 1 commit into
mapilio:mainfrom
chrisdebian:fix/platform-none-and-raw-configparser

Conversation

@chrisdebian
Copy link
Copy Markdown

Summary

When the Mapilio API returns a sequence whose osv.platform field is absent, api_data_details.get("osv", {}).get("platform") returns None. The subsequent check:

if platform == "iOS" or "iPhone" in platform:

raises TypeError: argument of type 'NoneType' is not iterable because the in operator requires a string on the right-hand side.

Fix

Add a truthiness guard so the branch is skipped cleanly when platform is None:

if platform == "iOS" or (platform and "iPhone" in platform):

Test plan

  • None platform → no exception, device make/model left at defaults
  • "iOS" platform → Apple branch taken as before
  • "iPhone12,1" platform → Apple branch taken via "iPhone" in platform
  • "Android" platform → Android branch taken as before

Closes #84

🤖 Generated with Claude Code

When the Mapilio API returns a sequence whose osv.platform field is
absent, api_data_details.get("osv", {}).get("platform") returns None.
The subsequent `"iPhone" in platform` check raises:

    TypeError: argument of type 'NoneType' is not iterable

Add a truthiness guard so the branch is skipped when platform is None.

Fixes mapilio#84

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

argument of type 'NoneType' is not iterable iPhone or iOS

1 participant