Make sure we have callbacks before proceeding with chatroom deletions (could cause a crash when deleting chatrooms quickly after login and/or changing views)

This commit is contained in:
QuentinArguillere 2022-11-28 14:19:31 +01:00
parent a98aa42ca4
commit 3dc7d4fb15

View file

@ -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;