Skip to content

Commit

Permalink
[iOS] - Fix VPN crashing if you purchase Leo AFTER VPN. (#26528)
Browse files Browse the repository at this point in the history
- Fix VPN crashing if you purchase Leo AFTER VPN.
  • Loading branch information
Brandon-T authored Nov 14, 2024
1 parent 9cdd2c1 commit 9cecaa8
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

import GuardianConnect
import Preferences
import Shared

extension BraveVPN {
Expand All @@ -14,11 +15,10 @@ extension BraveVPN {

/// Type of the active purchased vpn plan
public static var activeSubscriptionType: SubscriptionType {
guard let credential = GRDSubscriberCredential.current() else {
logAndStoreError("subscriptionName: failed to retrieve subscriber credentials")
guard let productId = Preferences.VPN.subscriptionProductId.value else {
logAndStoreError("subscriptionName: failed to retrieve productId")
return .other
}
let productId = credential.subscriptionType

switch productId {
case BraveVPNProductInfo.ProductIdentifiers.monthlySub:
Expand All @@ -32,11 +32,10 @@ extension BraveVPN {

/// Name of the purchased vpn plan.
public static var subscriptionName: String {
guard let credential = GRDSubscriberCredential.current() else {
logAndStoreError("subscriptionName: failed to retrieve subscriber credentials")
guard let productId = Preferences.VPN.subscriptionProductId.value else {
logAndStoreError("subscriptionName: failed to retrieve productId")
return ""
}
let productId = credential.subscriptionType

switch productId {
case BraveVPNProductInfo.ProductIdentifiers.monthlySub:
Expand Down

0 comments on commit 9cecaa8

Please # to comment.