diff --git a/src/controllers/SubscriptionsController.php b/src/controllers/SubscriptionsController.php index 33d478bdd7..838e9ef2e2 100644 --- a/src/controllers/SubscriptionsController.php +++ b/src/controllers/SubscriptionsController.php @@ -236,7 +236,7 @@ public function actionSubscribe(): ?Response $error = $exception->getMessage(); } - if (!$error && $returnUrl) { + if ($subscription && $returnUrl) { $returnUrl = $this->getView()->renderObjectTemplate($returnUrl, $subscription); $subscriptionRecord = SubscriptionRecord::findOne($subscription->id); $subscriptionRecord->returnUrl = $returnUrl;