Skip to content

Commit

Permalink
WIP: Fix secure coding error
Browse files Browse the repository at this point in the history
  • Loading branch information
Bunn committed Apr 11, 2024
1 parent 99b8fab commit c09a2b3
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum DataBrokerProtectionSchedulerStatus: Codable {
}

@objc
public class DataBrokerProtectionSchedulerErrorCollection: NSObject {
public class DataBrokerProtectionSchedulerErrorCollection: NSObject, NSSecureCoding {
/*
This needs to be an NSObject (rather than a struct) so it can be represented in Objective C
for the IPC layer
Expand All @@ -42,6 +42,22 @@ public class DataBrokerProtectionSchedulerErrorCollection: NSObject {
self.operationErrors = operationErrors
super.init()
}

// MARK: - NSSecureCoding

public static var supportsSecureCoding: Bool {
return true
}

public func encode(with coder: NSCoder) {
coder.encode(oneTimeError, forKey: "oneTimeError")
coder.encode(operationErrors, forKey: "operationErrors")
}

public required init?(coder: NSCoder) {
oneTimeError = coder.decodeObject(forKey: "oneTimeError") as? Error
operationErrors = coder.decodeObject(forKey: "operationErrors") as? [Error]
}
}

public protocol DataBrokerProtectionScheduler {
Expand Down

0 comments on commit c09a2b3

Please sign in to comment.