Handle null Darwin getTitleAsync results without crashing - #1391
Merged
Conversation
Agent-Logs-Url: https://github.com/fluttercandies/flutter_photo_manager/sessions/1e824610-84f1-4451-a184-0198436b15c0 Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix getTitleAsync returning null on iOS
Handle null Darwin May 14, 2026
getTitleAsync results without crashing
Member
|
@copilot Remove test and make it inlined. |
Agent-Logs-Url: https://github.com/fluttercandies/flutter_photo_manager/sessions/a8d11b04-cf85-4cee-bcb1-5f2cb627bb6f Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Pull request overview
This PR updates the Dart-side getTitleAsync implementation to avoid crashing when the Darwin platform channel returns null, and records the fix in the changelog.
Changes:
- Uses
invokeMethod<String>and falls back to''for null Darwin title results. - Keeps non-Darwin fallback behavior returning
entity.title ?? ''. - Adds an Unreleased changelog entry for the fix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
lib/src/internal/plugin.dart |
Adds null-safe fallback for Darwin getTitleAsync channel results. |
CHANGELOG.md |
Documents the Darwin getTitleAsync null-result fix under Unreleased fixes. |
4 tasks
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.
PhotoManagerPlugin.getTitleAsynccould receive anullresult from the Darwin platform channel even though the Dart API returnsFuture<String>. This change removes the non-null assumption and falls back to an empty string instead.Runtime fix
getTitleAsyncwith an inlined null-safe fallback (?? '') for iOS/macOS results.entity.title.Changelog
Unreleased.