Prevent crash bug edge case with sharing by email. Resolves GH-500

This commit is contained in:
Andrew Sliwinski 2016-04-06 18:22:50 -04:00
parent 3dc7e638ae
commit 56ee7f8b7c

View file

@ -342,6 +342,9 @@ JSContext *js;
mimeType = @"application/x-pbskids-scratchjr-project";
#endif
// Check to ensure modal is not nil. This can occur when the user does not have a mail account configured on their device
if (mailComposeViewController == nil) return;
[mailComposeViewController addAttachmentData:projectData mimeType:mimeType fileName:filename];
[self presentViewController:mailComposeViewController animated:YES completion:nil];
});