Skip to content

Fix crash saving null now-playing values to the iOS widget - #359

Open
NimbleAINinja wants to merge 1 commit into
pounat:mainfrom
NimbleAINinja:fix/ios-widget-null-userdefaults
Open

Fix crash saving null now-playing values to the iOS widget#359
NimbleAINinja wants to merge 1 commit into
pounat:mainfrom
NimbleAINinja:fix/ios-widget-null-userdefaults

Conversation

@NimbleAINinja

Copy link
Copy Markdown

Summary

HomeWidget.saveWidgetData passed Dart null for np_episode_id (books have no episode) and widget_cover_path. Null crosses the platform channel as NSNull, which NSUserDefaults rejects; binaries linked against the iOS 27 SDK turn that rejection into an uncaught NSInvalidArgumentException, aborting the app the moment playback starts. Builds from older SDKs (current CI) only logged a warning, which is why the store build doesn't crash.

The fix stores '' as the "absent" marker instead, matching the existing widget_chapter convention, and normalizes the readers: the Dart position-stash comparer and AbsorbPlayerCore's episode-id load treat '' as nil. Android widget readers already skip empty paths.

Testing

  • iOS: device tested — release build installed and verified on a physical iPhone (iOS 27); playback no longer crashes.
  • Android: compile tested only.

🤖 Generated with Claude Code

HomeWidget.saveWidgetData passed Dart null for np_episode_id (books
have no episode) and widget_cover_path. Null crosses the platform
channel as NSNull, which NSUserDefaults rejects; binaries linked
against the iOS 27 SDK turn that rejection into an uncaught
NSInvalidArgumentException, aborting the app the moment playback
starts. Builds from older SDKs (current CI) only logged a warning,
which is why the store build doesn't crash.

Store '' as the "absent" marker instead, matching the existing
widget_chapter convention, and normalize the readers: the Dart
position-stash comparer and AbsorbPlayerCore's episode-id load treat
'' as nil. Android widget readers already skip empty paths.

Co-Authored-By: Claude Fable 5 <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.

1 participant