From 7ccdcbebcf9e4c1aaa5348c69ad27ab2d2d5fa84 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 28 Nov 2022 16:30:57 +0100 Subject: [PATCH] Ensure that the result of linphone_event_log_get_chat_message(_event) is not nil before trying to use it --- Classes/ChatConversationImdnView.m | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Classes/ChatConversationImdnView.m b/Classes/ChatConversationImdnView.m index a2c485dc4..6ee0897a7 100644 --- a/Classes/ChatConversationImdnView.m +++ b/Classes/ChatConversationImdnView.m @@ -87,12 +87,14 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)updateImdnList { if (_event) { LinphoneChatMessage *_msg = linphone_event_log_get_chat_message(_event); - _displayedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDisplayed); - _receivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDeliveredToUser); - _notReceivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDelivered); - _errorList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateNotDelivered); - - [_tableView reloadData]; + if (_msg) { + _displayedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDisplayed); + _receivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDeliveredToUser); + _notReceivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDelivered); + _errorList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateNotDelivered); + + [_tableView reloadData]; + } } }