Skip to content

Commit

Permalink
Restore some previous code deleted by accident
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuskurgonas committed May 5, 2022
1 parent 6aaa170 commit a0a50cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/Contentful/ArrayResponse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ extension KeyedDecodingContainer {


guard let itemsAsDictionaries = try self.decodeIfPresent(Swift.Array<Any>.self, forKey: key) as? [[String: Any]] else {
// We can not just ignore this as it failed to parse the whole data - not only a single entry
throw SDKError.unparseableJSON(data: nil, errorMessage: "SDK was unable to deserialize returned resources")
if throwIfNotPresent {
throw SDKError.unparseableJSON(data: nil, errorMessage: "SDK was unable to deserialize returned resources")
} else {
return nil
}
}
var entriesJSONContainer = try self.nestedUnkeyedContainer(forKey: key)

Expand Down

0 comments on commit a0a50cc

Please sign in to comment.