From 3dc7d4fb15d941ffede496e38ee49b0aebd23fd8 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Mon, 28 Nov 2022 14:19:31 +0100 Subject: [PATCH] Make sure we have callbacks before proceeding with chatroom deletions (could cause a crash when deleting chatrooms quickly after login and/or changing views) --- Classes/ChatsListTableView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Classes/ChatsListTableView.m b/Classes/ChatsListTableView.m index 581f66c82..bdbb615d4 100644 --- a/Classes/ChatsListTableView.m +++ b/Classes/ChatsListTableView.m @@ -191,7 +191,7 @@ static int sorted_history_comparison(LinphoneChatRoom *to_insert, LinphoneChatRo void deletion_chat_room_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState) { LinphoneChatRoomCbs *cbs = linphone_chat_room_get_current_callbacks(cr); - ChatsListTableView *view = (__bridge ChatsListTableView *)linphone_chat_room_cbs_get_user_data(cbs) ?: NULL; + ChatsListTableView *view =cbs ? ((__bridge ChatsListTableView *)linphone_chat_room_cbs_get_user_data(cbs) ?: NULL) : NULL; if (!view) return;