From 44ead07a02a31a6979ec37bc3ebab1276a21f5a1 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Wed, 4 Feb 2015 19:02:33 +0800 Subject: [PATCH] Fix send mail crash when not email account --- SuperLogger/SuperLogerListView.m | 6 +++++- SuperLogger/SuperLoggerPreviewView.m | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/SuperLogger/SuperLogerListView.m b/SuperLogger/SuperLogerListView.m index fef035f..1523d45 100644 --- a/SuperLogger/SuperLogerListView.m +++ b/SuperLogger/SuperLogerListView.m @@ -147,7 +147,11 @@ - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger [picker setMessageBody:logger.mailContect isHTML:NO]; [picker setMailComposeDelegate:self]; dispatch_async(dispatch_get_main_queue(), ^(void){ - [self presentViewController:picker animated:YES completion:nil]; + @try { + [self presentViewController:picker animated:YES completion:nil]; + } + @catch (NSException * e) + { NSLog(@"Exception: %@", e); } }); } }]; diff --git a/SuperLogger/SuperLoggerPreviewView.m b/SuperLogger/SuperLoggerPreviewView.m index 9545f82..46ade5b 100644 --- a/SuperLogger/SuperLoggerPreviewView.m +++ b/SuperLogger/SuperLoggerPreviewView.m @@ -76,7 +76,11 @@ -(void)send [picker setToRecipients:[NSArray array]]; [picker setMessageBody:logger.mailContect isHTML:NO]; [picker setMailComposeDelegate:self]; - [self presentViewController:picker animated:YES completion:nil]; + @try { + [self presentViewController:picker animated:YES completion:nil]; + } + @catch (NSException * e) + { NSLog(@"Exception: %@", e); } } }]; }