You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__SwiftValue encodeWithCoder:]: unrecognized selector sent to instance 0x600002592800'
terminating with uncaught exception of type NSException
I've read and understood the Contributing guidelines and have done my best effort to follow them.
I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
The reason of the crash is the following function: private func setSecret (_ value: Any?, forKey defaultName: String) { if let value = value { let data = NSKeyedArchiver.archivedData (withRootObject: value) super.set (try? encrypter?.encrypt (data), forKey: defaultName) return } super.set (nil, forKey: defaultName) }
Only NSCoding conforming objects can be stored in NSKeyedArchive as far as I know.
Reproducible in:
SecureDefaults version: 1.0.7
iOS version: 15.5
Steps to reproduce:
set value with type that is not available for obj-c
get crash
Expected result:
It should save the value
Actual result:
crash
The text was updated successfully, but these errors were encountered:
Description
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__SwiftValue encodeWithCoder:]: unrecognized selector sent to instance 0x600002592800'
terminating with uncaught exception of type NSException
Requirements (place an
x
in each of the[ ]
)Bug Report
The reason of the crash is the following function:
private func setSecret (_ value: Any?, forKey defaultName: String) { if let value = value { let data = NSKeyedArchiver.archivedData (withRootObject: value) super.set (try? encrypter?.encrypt (data), forKey: defaultName) return } super.set (nil, forKey: defaultName) }
Only NSCoding conforming objects can be stored in NSKeyedArchive as far as I know.
Reproducible in:
SecureDefaults version: 1.0.7
iOS version: 15.5
Steps to reproduce:
Expected result:
It should save the value
Actual result:
crash
The text was updated successfully, but these errors were encountered: