Skip to content
Snippets Groups Projects
Commit fa00bd1d authored by Emmanuel Lepage Vallée's avatar Emmanuel Lepage Vallée Committed by Stepan Salenikovich
Browse files

phonedirectory: prevent unlikely null dereference


There is a code path combination (that should not happen, but is
reachable) that could cause a null dereference.

[SS: add warning log in case it happens to make it easier to track down]

Change-Id: I1c2c2b5be417e9ec74e0ab157c9aadcd0ec4a613
Signed-off-by: default avatarStepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
Reviewed-by: default avatarStepan Salenikovich <stepan.salenikovich@savoirfairelinux.com>
parent 0ee4e3ab
No related branches found
No related tags found
No related merge requests found
......@@ -599,7 +599,11 @@ ContactMethod* PhoneDirectoryModel::getNumber(const QString& uri, Person* contac
d_ptr->m_hDirectory [extendedUri] = wrap2;
d_ptr->m_hSortedNumbers[extendedUri] = wrap2;
}
wrap2->numbers << number;
if (wrap2)
wrap2->numbers << number;
else
qWarning() << "PhoneDirectoryModel: code path should not be reached, wrap2 is nullptr";
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment