From da2945e6facfc1d5eee7a0a9de590ea699b82450 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 13 Jan 2017 09:59:19 +0100 Subject: [PATCH] Fix crash : national_significant number can be NULL --- Classes/AssistantView.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Classes/AssistantView.m b/Classes/AssistantView.m index 8787e3327..a15b88b13 100644 --- a/Classes/AssistantView.m +++ b/Classes/AssistantView.m @@ -873,10 +873,12 @@ static UICompositeViewDescription *compositeDescription = nil; UIView *usernameView = [self findView:ViewElement_UsernameFormView inView:self.contentView ofType:UIView.class]; usernameView.hidden = !usernameSwitch.isOn; - ((UITextField *)[self findView:ViewElement_Phone - inView:_linphoneLoginView - ofType:[UIAssistantTextField class]]) - .text = [NSString stringWithUTF8String:nationnal_significant_number]; + if (nationnal_significant_number) { + ((UITextField *)[self findView:ViewElement_Phone + inView:_linphoneLoginView + ofType:[UIAssistantTextField class]]) + .text = [NSString stringWithUTF8String:nationnal_significant_number]; + } ((UITextField *)[self findView:ViewElement_SMSCode inView:_createAccountActivateSMSView ofType:[UITextField class]]) @@ -886,8 +888,10 @@ static UICompositeViewDescription *compositeDescription = nil; [CountryListView countryWithIso:[NSString stringWithUTF8String:dialplan.iso_country_code]]; [self didSelectCountry:country]; // Reset phone number in account_creator to be sure to let the user retry - linphone_account_creator_set_phone_number(account_creator, nationnal_significant_number, - dialplan.ccc); + if (nationnal_significant_number) { + linphone_account_creator_set_phone_number(account_creator, nationnal_significant_number, + dialplan.ccc); + } }]; defaultAction.accessibilityLabel = @"PopUpResp";