diff --git a/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift b/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift index ae16e37e3a..47e50411d9 100644 --- a/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift +++ b/submodules/TelegramCore/Sources/AccountManager/AccountManagerImpl.swift @@ -124,8 +124,11 @@ final class AccountManagerImpl { self.currentAtomicState = atomicState } catch let e { postboxLog("decode atomic state error: \(e)") - let _ = try? FileManager.default.removeItem(atPath: self.atomicStatePath) postboxLogSync() + + if removeDatabaseOnError { + let _ = try? FileManager.default.removeItem(atPath: self.atomicStatePath) + } preconditionFailure() } } catch let e {