fix sneaky transaction deadlock

This commit is contained in:
Michael Kirk 2019-05-14 19:10:13 -06:00
parent 3e55b071da
commit c8d6ae9bc8

View File

@ -119,12 +119,12 @@ public class SDSKeyValueStore: NSObject {
@objc
public func setObject(_ anyValue: Any?, key: String, transaction: SDSAnyWriteTransaction) {
guard let anyValue = anyValue else {
write(nil, forKey: key)
write(nil, forKey: key, transaction: transaction)
return
}
guard let codingValue = anyValue as? NSCoding else {
owsFailDebug("Invalid value.")
write(nil, forKey: key)
write(nil, forKey: key, transaction: transaction)
return
}
write(codingValue, forKey: key, transaction: transaction)