[share]fix iOS crash when setting the subject to null#2131
[share]fix iOS crash when setting the subject to null#2131cyanglaz merged 4 commits intoflutter:masterfrom
Conversation
| @@ -0,0 +1,19 @@ | |||
| import 'dart:async'; | |||
There was a problem hiding this comment.
oops! How funny that this is included in this PR
| } | ||
|
|
||
| - (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController { | ||
| return @""; |
There was a problem hiding this comment.
curious - should this be null?
There was a problem hiding this comment.
It should be one that the activity can handle otherwise you may get an activity with empty content.
So setting it to null/nil will result the activityController showing an empty content (manually tested)
cyanglaz
left a comment
There was a problem hiding this comment.
Removed video player stuff
| } | ||
|
|
||
| - (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController { | ||
| return @""; |
There was a problem hiding this comment.
It should be one that the activity can handle otherwise you may get an activity with empty content.
So setting it to null/nil will result the activityController showing an empty content (manually tested)
| @@ -0,0 +1,19 @@ | |||
| import 'dart:async'; | |||
There was a problem hiding this comment.
oops! How funny that this is included in this PR
When subject is set to null, iOS will set the subject to NSNull which results a crash. This PR defaults NSNull to nil before setting the subject. It also avoid the undocumented KVC implementation in the legacy code and instead, use the UIActivityItemSource. Also fixed a compiler warning with giving originRect an initial value.
When subject is set to null, iOS will set the subject to NSNull which results a crash. This PR defaults NSNull to nil before setting the subject. It also avoid the undocumented KVC implementation in the legacy code and instead, use the UIActivityItemSource. Also fixed a compiler warning with giving originRect an initial value.
Description
When subject is set to null, iOS will set the subject to NSNull which results a crash.
This PR defaults NSNull to nil before setting the subject.
It also avoid the undocumented KVC implementation in the legacy code and instead, use the UIActivityItemSource.
Also fixed a compiler warning with giving originRect an initial value while I'm at it.
Related Issues
flutter/flutter#39740
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?