From df21fa7dc5e80febdeb875f659dcaf0d926de9c7 Mon Sep 17 00:00:00 2001 From: Alfonso Grillo Date: Tue, 3 Oct 2023 17:11:17 +0200 Subject: [PATCH] Fix DM crash with RTE enabled --- Riot/Modules/Room/RoomViewController.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index a65ba666cf..ee118fcaf4 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -3121,15 +3121,16 @@ - (void)displayRoomPreview:(RoomPreviewData *)previewData - (void)displayNewDirectChatWithTargetUser:(nonnull MXUser*)directChatTargetUser session:(nonnull MXSession*)session { + // `[displayRoom:]` may require the session, setting it here before calling it + [self addMatrixSession:session]; + // Release existing room data source or preview [self displayRoom:nil]; self.directChatTargetUser = directChatTargetUser; self.eventsAcknowledgementEnabled = NO; - - [self addMatrixSession:session]; - + [self refreshRoomTitle]; [self refreshRoomInputToolbar]; }