From 8bc49f01c55871fd6ebb672573886121e15b2b2f Mon Sep 17 00:00:00 2001 From: aagolubenko Date: Mon, 12 Jun 2023 14:11:40 +0100 Subject: [PATCH] [https://trello.com/c/CxcJke7p] MacOS crash fix --- Adamant/Stories/Chat/View/ChatViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Adamant/Stories/Chat/View/ChatViewController.swift b/Adamant/Stories/Chat/View/ChatViewController.swift index e29137583..6a6898840 100644 --- a/Adamant/Stories/Chat/View/ChatViewController.swift +++ b/Adamant/Stories/Chat/View/ChatViewController.swift @@ -371,7 +371,7 @@ private extension ChatViewController { /// This gesture controls the position of the input bar when the keyboard is open and the user swipes it to dismiss. /// Due to incorrect checks in MessageKit, we manually set the delegate and assign it to our custom chatKeyboardManager object. /// This ensures proper handling and control of the pan gesture for the input bar. - if let gesture = messagesCollectionView.gestureRecognizers?[13] as? UIPanGestureRecognizer { + if let gesture = messagesCollectionView.gestureRecognizers?[safe: 13] as? UIPanGestureRecognizer { gesture.delegate = chatKeyboardManager chatKeyboardManager.panGesture = gesture }