Never delete data in extensions

This commit is contained in:
Ali 2023-10-31 18:19:44 +04:00
parent 58bf113ecf
commit dbf2e348f1

View File

@ -124,8 +124,11 @@ final class AccountManagerImpl<Types: AccountManagerTypes> {
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 {