From e5a08e7a8eec6818fbb5ba6af7185e3093c0aa2a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 27 Apr 2012 11:05:00 +0200 Subject: [PATCH] Capth potention LC is null exception --- Classes/MainScreenWithVideoPreview.m | 10 +++++++++- Classes/PhoneViewController.m | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Classes/MainScreenWithVideoPreview.m b/Classes/MainScreenWithVideoPreview.m index 118c6af0a..c35983820 100644 --- a/Classes/MainScreenWithVideoPreview.m +++ b/Classes/MainScreenWithVideoPreview.m @@ -128,10 +128,18 @@ -(void) showPreview:(BOOL) show { + LinphoneCore* lc; + @try { + lc = [LinphoneManager getLc]; + } + @catch (NSException *exception) { + return; + } + bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"]; if (enableVideo) { - LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]); + LinphoneCall* call = linphone_core_get_current_call(lc); if (show && call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) { return; } diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 9d1f45a12..518f3bcd9 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -113,7 +113,7 @@ [callShort setEnabled:!linphone_core_sound_resources_locked([LinphoneManager getLc])]; } @catch (NSException* exc) { // R.A.S: linphone core si simply not ready... - ms_warning("Exception %s: %s", + ms_warning("Catched exception %s: %s", [exc.name cStringUsingEncoding:[NSString defaultCStringEncoding]], [exc.reason cStringUsingEncoding:[NSString defaultCStringEncoding]]); }