diff --git a/src/Simplex/Chat.hs b/src/Simplex/Chat.hs index 2a568d628..5b56c0ac8 100644 --- a/src/Simplex/Chat.hs +++ b/src/Simplex/Chat.hs @@ -897,7 +897,8 @@ processChatCommand = \case filesInfo <- withStore' $ \db -> getContactFileInfo db user ct withChatLock "deleteChat direct" . procCmd $ do deleteFilesAndConns user filesInfo - when (contactActive ct && notify) . void $ sendDirectContactMessage ct XDirectDel + when (isReady ct && contactActive ct && notify) $ + void (sendDirectContactMessage ct XDirectDel) `catchChatError` const (pure ()) contactConnIds <- map aConnId <$> withStore (\db -> getContactConnections db userId ct) deleteAgentConnectionsAsync user contactConnIds -- functions below are called in separate transactions to prevent crashes on android