File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ public struct GraphQLError: Error, Codable {
118
118
public init ( from decoder: Decoder ) throws {
119
119
let container = try decoder. container ( keyedBy: CodingKeys . self)
120
120
message = try container. decode ( String . self, forKey: . message)
121
- locations = try container. decode ( [ SourceLocation] ? . self, forKey: . locations) ?? [ ]
121
+ locations = ( try ? container. decode ( [ SourceLocation] ? . self, forKey: . locations) ) ?? [ ]
122
122
path = try container. decode ( IndexPath . self, forKey: . path)
123
123
}
124
124
@@ -166,7 +166,7 @@ public struct IndexPath: Codable {
166
166
167
167
public init ( from decoder: Decoder ) throws {
168
168
var container = try decoder. unkeyedContainer ( )
169
- elements = try container. decode ( [ IndexPathValue ] . self)
169
+ elements = ( try ? container. decode ( [ IndexPathValue ] . self) ) ?? [ ]
170
170
}
171
171
172
172
public func encode( to encoder: Encoder ) throws {
You can’t perform that action at this time.
0 commit comments