From 90f3a82492fa56aca04926cf28def9529a00fd84 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 4 Oct 2019 16:05:51 +0100 Subject: [PATCH 1/3] Do not set subject, if the variable itself is nil/NSNull --- packages/share/ios/Classes/SharePlugin.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/share/ios/Classes/SharePlugin.m b/packages/share/ios/Classes/SharePlugin.m index cfd8eac6876d..7559929625ff 100644 --- a/packages/share/ios/Classes/SharePlugin.m +++ b/packages/share/ios/Classes/SharePlugin.m @@ -55,7 +55,9 @@ + (void)share:(id)sharedItems UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[ sharedItems ] applicationActivities:nil]; - [activityViewController setValue:subject forKey:@"subject"]; + if (subject && ![subject isKindOfClass:[NSNull class]]) { + [activityViewController setValue:subject forKey:@"subject"]; + } activityViewController.popoverPresentationController.sourceView = controller.view; if (!CGRectIsEmpty(origin)) { activityViewController.popoverPresentationController.sourceRect = origin; From 31dd2af46d64aa68afa3f74475c0a333738283a1 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 4 Oct 2019 16:06:55 +0100 Subject: [PATCH 2/3] Initialize originRect --- packages/share/ios/Classes/SharePlugin.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/share/ios/Classes/SharePlugin.m b/packages/share/ios/Classes/SharePlugin.m index 7559929625ff..b6bcb784ff6e 100644 --- a/packages/share/ios/Classes/SharePlugin.m +++ b/packages/share/ios/Classes/SharePlugin.m @@ -31,7 +31,7 @@ + (void)registerWithRegistrar:(NSObject *)registrar { NSNumber *originWidth = arguments[@"originWidth"]; NSNumber *originHeight = arguments[@"originHeight"]; - CGRect originRect; + CGRect originRect = CGRectZero; if (originX != nil && originY != nil && originWidth != nil && originHeight != nil) { originRect = CGRectMake([originX doubleValue], [originY doubleValue], [originWidth doubleValue], [originHeight doubleValue]); From ee27fd40c8f5106e68138c134969ae19912862a1 Mon Sep 17 00:00:00 2001 From: Sebastian Roth Date: Fri, 4 Oct 2019 16:07:42 +0100 Subject: [PATCH 3/3] Bump version, add changelog. --- packages/share/CHANGELOG.md | 4 ++++ packages/share/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/share/CHANGELOG.md b/packages/share/CHANGELOG.md index 7ac36c080c33..e10db5b351fc 100644 --- a/packages/share/CHANGELOG.md +++ b/packages/share/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.3 + +* Resolve a crash when not setting the subject variable and sharing to Mail. + ## 0.6.2+2 * Update and migrate iOS example project. diff --git a/packages/share/pubspec.yaml b/packages/share/pubspec.yaml index d140fab114c5..fc11e713150c 100644 --- a/packages/share/pubspec.yaml +++ b/packages/share/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for sharing content via the platform share UI, using the ACTION_SEND intent on Android and UIActivityViewController on iOS. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/share -version: 0.6.2+2 +version: 0.6.3 flutter: plugin: