Commit b52f0507 authored by Sylvain Berfini's avatar Sylvain Berfini

Fix crashes link to changes in contact found callback in previous commit

parent 54f649ba
......@@ -659,13 +659,16 @@ namespace Linphone.Model
/// </summary>
private void OnContactFound(object sender, ContactFoundEventArgs e)
{
Logger.Msg("[LinphoneManager] Contact found: " + e.ContactFound.DisplayName);
ContactManager.ContactFound -= OnContactFound;
// Store the contact name as display name for call logs
if (LinphoneManager.Instance.LinphoneCore.GetCurrentCall() != null)
if (e.ContactFound != null)
{
LinphoneManager.Instance.LinphoneCore.GetCurrentCall().GetRemoteAddress().SetDisplayName(e.ContactFound.DisplayName);
Logger.Msg("[LinphoneManager] Contact found: " + e.ContactFound.DisplayName);
ContactManager.ContactFound -= OnContactFound;
// Store the contact name as display name for call logs
if (LinphoneManager.Instance.LinphoneCore.GetCurrentCall() != null)
{
LinphoneManager.Instance.LinphoneCore.GetCurrentCall().GetRemoteAddress().SetDisplayName(e.ContactFound.DisplayName);
}
}
}
#endregion
......
......@@ -93,14 +93,17 @@ namespace Linphone.Views
/// </summary>
private void cm_ContactFound(object sender, ContactFoundEventArgs e)
{
Contact.Text = e.ContactFound.DisplayName;
if (e.PhoneLabel != null)
if (e.ContactFound != null)
{
Number.Text = e.PhoneLabel + " : " + e.PhoneNumber;
}
else
{
Number.Text = e.PhoneNumber;
Contact.Text = e.ContactFound.DisplayName;
if (e.PhoneLabel != null)
{
Number.Text = e.PhoneLabel + " : " + e.PhoneNumber;
}
else
{
Number.Text = e.PhoneNumber;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment