Fix crashes when sending chats to strange addresses

This commit is contained in:
Guillaume BIENKOWSKI 2015-01-19 10:47:05 +01:00
parent e389a03405
commit 6a82937bbd
2 changed files with 8 additions and 2 deletions

View file

@ -292,7 +292,10 @@ static UICompositeViewDescription *compositeDescription = nil;
// Display name
if(displayName == nil) {
displayName = [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)];
const char* username = linphone_address_get_username(linphoneAddress);
char* address = linphone_address_as_string(linphoneAddress);
displayName = [NSString stringWithUTF8String:username?:address];
ms_free(address);
}
[addressLabel setText:displayName];

View file

@ -99,7 +99,10 @@
// Display name
if(displayName == nil) {
displayName = [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)];
const char* username = linphone_address_get_username(linphoneAddress);
char* address = linphone_address_as_string(linphoneAddress);
displayName = [NSString stringWithUTF8String:username?:address];
ms_free(address);
}
[addressLabel setText:displayName];