forked from shadowfacts/Tusker
parent
26c483fc9a
commit
54376ac585
|
@ -63,6 +63,9 @@ public struct OptionalURLDecoder: Codable, Sendable, Hashable, ExpressibleByNilL
|
|||
self.wrappedValue = nil
|
||||
} else {
|
||||
let s = try container.decode(String.self)
|
||||
if s.isEmpty {
|
||||
self.wrappedValue = nil
|
||||
} else {
|
||||
do {
|
||||
self.wrappedValue = try parseStrategy.parse(s)
|
||||
} catch {
|
||||
|
@ -70,6 +73,7 @@ public struct OptionalURLDecoder: Codable, Sendable, Hashable, ExpressibleByNilL
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func encode(to encoder: any Encoder) throws {
|
||||
var container = encoder.singleValueContainer()
|
||||
|
|
Loading…
Reference in New Issue