From ec4b2d8331c790fdafaf0479cfe39f2e04f79df3 Mon Sep 17 00:00:00 2001 From: Michal Smaga Date: Mon, 5 Aug 2024 14:16:02 +0200 Subject: [PATCH] Return App Store subscription options only if not nil (#3068) Task/Issue URL: https://app.asana.com/0/1203936086921904/1207934463147478/f **Description**: In case no App Store subscription objects are available we should return a proper `SubscriptionOptions.empty` object. --- .../SubscriptionPagesUseSubscriptionFeature.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/Tab/UserScripts/Subscription/SubscriptionPagesUseSubscriptionFeature.swift b/DuckDuckGo/Tab/UserScripts/Subscription/SubscriptionPagesUseSubscriptionFeature.swift index ad14f0ac86..2251e93e27 100644 --- a/DuckDuckGo/Tab/UserScripts/Subscription/SubscriptionPagesUseSubscriptionFeature.swift +++ b/DuckDuckGo/Tab/UserScripts/Subscription/SubscriptionPagesUseSubscriptionFeature.swift @@ -151,7 +151,9 @@ final class SubscriptionPagesUseSubscriptionFeature: Subfeature { switch subscriptionPlatform { case .appStore: if #available(macOS 12.0, *) { - return await subscriptionManager.storePurchaseManager().subscriptionOptions() + if let subscriptionOptions = await subscriptionManager.storePurchaseManager().subscriptionOptions() { + return subscriptionOptions + } } case .stripe: switch await stripePurchaseFlow.subscriptionOptions() {