diff --git a/Packages/Pachyderm/Sources/Pachyderm/Utilities/URLDecoder.swift b/Packages/Pachyderm/Sources/Pachyderm/Utilities/URLDecoder.swift index 502595fd..fff68776 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Utilities/URLDecoder.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Utilities/URLDecoder.swift @@ -63,10 +63,14 @@ public struct OptionalURLDecoder: Codable, Sendable, Hashable, ExpressibleByNilL self.wrappedValue = nil } else { let s = try container.decode(String.self) - do { - self.wrappedValue = try parseStrategy.parse(s) - } catch { - throw DecodingError.dataCorrupted(.init(codingPath: container.codingPath, debugDescription: "Could not decode URL '\(s)'", underlyingError: error)) + if s.isEmpty { + self.wrappedValue = nil + } else { + do { + self.wrappedValue = try parseStrategy.parse(s) + } catch { + throw DecodingError.dataCorrupted(.init(codingPath: container.codingPath, debugDescription: "Could not decode URL '\(s)'", underlyingError: error)) + } } } }