ios: prevent a crash when exiting the app (#4041)

* ios: prevent a crash when exiting the app

* log
This commit is contained in:
Stanislav Dmitrenko
2024-04-19 13:23:13 +07:00
committed by GitHub
parent 065c8f8861
commit 505c6cb062
+5
View File
@@ -87,6 +87,11 @@ public func chatInitControllerRemovingDatabases() {
public func chatCloseStore() {
// Prevent crash when exiting the app with already closed store (for example, after changing a database passpharase)
guard hasChatCtrl() else {
logger.error("chatCloseStore: already closed, chatCtrl is nil")
return
}
let err = fromCString(chat_close_store(getChatCtrl()))
if err != "" {
logger.error("chatCloseStore error: \(err)")