From ea4772e3d41db83e5a7ea09910e903e9b0db8f4b Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 7 Oct 2024 09:46:56 +0200 Subject: [PATCH] Fix Purchase decoding --- PadelClub/Views/Tournament/Subscription/Purchase.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PadelClub/Views/Tournament/Subscription/Purchase.swift b/PadelClub/Views/Tournament/Subscription/Purchase.swift index c37c957..103b5e4 100644 --- a/PadelClub/Views/Tournament/Subscription/Purchase.swift +++ b/PadelClub/Views/Tournament/Subscription/Purchase.swift @@ -71,7 +71,7 @@ class Purchase: ModelObject, Storable { self.user = try container.decodeEncrypted(key: .user) self.purchaseDate = try container.decode(Date.self, forKey: .purchaseDate) self.productId = try container.decode(String.self, forKey: .productId) - self.quantity = try container.decode(Int.self, forKey: .quantity) + self.quantity = try container.decodeIfPresent(Int.self, forKey: .quantity) self.revocationDate = try container.decodeIfPresent(Date.self, forKey: .revocationDate) self.expirationDate = try container.decodeIfPresent(Date.self, forKey: .expirationDate) }