From 581df47d44787fe9e915c079154173d0861485cf Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Mon, 26 Jan 2015 15:07:16 +0100 Subject: [PATCH] Don't crash when the chat room doesn't exist --- Classes/LinphoneAppDelegate.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index d9c68a97d..b6b487a44 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -351,9 +351,9 @@ NSString *remoteContact = (NSString*)[notification.userInfo objectForKey:@"from"]; // Go to ChatRoom view [[PhoneMainView instance] changeCurrentView:[ChatViewController compositeViewDescription]]; + LinphoneChatRoom*room = [self findChatRoomForContact:remoteContact]; ChatRoomViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ChatRoomViewController compositeViewDescription] push:TRUE], ChatRoomViewController); - if(controller != nil) { - LinphoneChatRoom*room = [self findChatRoomForContact:remoteContact]; + if(controller != nil && room != nil) { [controller setChatRoom:room]; } } else if([notification.userInfo objectForKey:@"callLog"] != nil) {