Check that contact address has a valid username when trying to match phone numbers

This commit is contained in:
QuentinArguillere 2022-11-22 17:25:23 +01:00
parent 9977644872
commit b6ff317551

View file

@ -494,7 +494,7 @@
for (NSString *address in _sipAddresses) {
LinphoneAddress *addr = linphone_core_interpret_url_2(LC, [address UTF8String], YES);
bool isFoundInPhones = false;
if (addr) {
if (addr && linphone_address_get_username(addr)) {
for (NSString *phoneNb in _phones) {
if ([phoneNb isEqualToString:[NSString stringWithUTF8String:linphone_address_get_username(addr)]]) {
isFoundInPhones = true;