diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 9e1c36f49..480d99e11 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -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]; diff --git a/Classes/LinphoneUI/UIChatCell.m b/Classes/LinphoneUI/UIChatCell.m index 6662669ac..5fcf753ad 100644 --- a/Classes/LinphoneUI/UIChatCell.m +++ b/Classes/LinphoneUI/UIChatCell.m @@ -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];