Add null handling for backup subscriptions.

This commit is contained in:
Alex Hart
2025-11-04 11:14:12 -04:00
committed by Michelle Tang
parent 8c99843b2d
commit abbec60465

View File

@@ -164,8 +164,13 @@ class InAppPaymentRecurringContextJob private constructor(
val subscription = activeSubscription.activeSubscription
if (subscription == null) {
warning("Subscription is null. Retrying later.")
throw InAppPaymentRetryException()
if (inAppPayment.type == InAppPaymentType.RECURRING_BACKUP) {
warning("Backup subscription is null.")
throw Exception()
} else {
warning("${inAppPayment.type} Subscription is null. Retrying later.")
throw InAppPaymentRetryException()
}
}
handlePossibleFailedPayment(inAppPayment, activeSubscription, subscription)