fix: prevent NullPointerException in BackgroundWorker.getDartTask#636
Merged
fix: prevent NullPointerException in BackgroundWorker.getDartTask#636
Conversation
- workmanager_apple@0.9.1 - workmanager@0.9.0+1
- Remove invalid 'processing' value from UIBackgroundModes - Add clarification that BGTaskScheduler doesn't require UIBackgroundModes - Link to Apple's official UIBackgroundModes documentation - Update workmanager version to 0.9.0 in installation instructions Fixes #633
This reverts commit 7116f5f.
- Replace Xcode Help link with Apple's Configuration Guide - Add link to UIBackgroundModes property list documentation - Provide both practical configuration and technical reference links Fixes #633
- Remove non-null assertion operator (!!) from dartTask property - Add null checks in all methods that use dartTask - Handle null dart task gracefully with proper error reporting - Fixes crash when DART_TASK_KEY is missing from worker input data Fixes #635
|
To view this pull requests documentation preview, visit the following URL: docs.page/fluttercommunity/flutter_workmanager~636 Documentation is deployed and generated using docs.page. |
This reverts commit aa9e3b6.
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
Changes
dartTaskproperty getterdartTaskWorkmanagerDebug.onExceptionEncounteredResult.failure()when dart task is nullRoot Cause
The issue was caused by renaming the
DART_TASK_KEYin a previous commit, which broke compatibility with existing cached worker data. Apps would crash until users cleared cache or reinstalled.Credit
This fix is based on the excellent work and analysis by @ColinSchmale in PR #635. Thank you for identifying the issue and providing the solution!
Testing
Closes #635
Co-authored-by: ColinSchmale colin@schmale.dev