Fix crash : national_significant number can be NULL

This commit is contained in:
Benjamin Reis 2017-01-13 09:59:19 +01:00
parent 55dd071043
commit da2945e6fa

View file

@ -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";