Fix crash saving null now-playing values to the iOS widget - #359
Open
NimbleAINinja wants to merge 1 commit into
Open
Fix crash saving null now-playing values to the iOS widget#359NimbleAINinja wants to merge 1 commit into
NimbleAINinja wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HomeWidget.saveWidgetDatapassed Dartnullfornp_episode_id(books have no episode) andwidget_cover_path. Null crosses the platform channel asNSNull, whichNSUserDefaultsrejects; binaries linked against the iOS 27 SDK turn that rejection into an uncaughtNSInvalidArgumentException, 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 existingwidget_chapterconvention, and normalizes the readers: the Dart position-stash comparer andAbsorbPlayerCore's episode-id load treat''as nil. Android widget readers already skip empty paths.Testing
🤖 Generated with Claude Code