From 06ce01bc3abb367b27da28f50bd552efa684b157 Mon Sep 17 00:00:00 2001 From: Andrew Edwards Date: Fri, 18 Oct 2019 15:23:12 -0400 Subject: [PATCH] Decode for optional property. --- .../Models/Connect/External Accounts/ExternalAccounts.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/StripeKit/Models/Connect/External Accounts/ExternalAccounts.swift b/Sources/StripeKit/Models/Connect/External Accounts/ExternalAccounts.swift index 254c20ef..16172cfa 100644 --- a/Sources/StripeKit/Models/Connect/External Accounts/ExternalAccounts.swift +++ b/Sources/StripeKit/Models/Connect/External Accounts/ExternalAccounts.swift @@ -28,7 +28,7 @@ public struct StripeExternalAccountsList: StripeModel { public init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) object = try container.decode(String.self, forKey: .object) - hasMore = try container.decode(Bool.self, forKey: .hasMore) + hasMore = try container.decodeIfPresent(Bool.self, forKey: .hasMore) url = try container.decodeIfPresent(String.self, forKey: .url) cardAccounts = try container.decodeIfPresent([StripeCard].self, forKey: .data)?.filter{ $0.object == "card" }