diff --git a/web/modules/custom/materio_commerce/materio_commerce.module b/web/modules/custom/materio_commerce/materio_commerce.module index b3bca4fc..73d6a468 100644 --- a/web/modules/custom/materio_commerce/materio_commerce.module +++ b/web/modules/custom/materio_commerce/materio_commerce.module @@ -229,8 +229,10 @@ function materio_commerce_form_user_form_alter(&$form, &$form_state, $form_id) { $subscription_url = $first_subscription->toUrl(); $subscription_title = $first_subscription->getTitle(); $subscription_state = $first_subscription->get('state')->first()->getValue()['value']; - $subscription_payment_method = $first_subscription->getPaymentMethod(); - $subscription_payment_method_label = $subscription_payment_method->label()->render(); + $subscription_payment_method_label = "none"; + if ( $subscription_payment_method = $first_subscription->getPaymentMethod() ){ + $subscription_payment_method_label = $subscription_payment_method->label()->render(); + } $subscription_link = Link::fromTextAndUrl(t("subscription @title @state [@pm_label]", array( '@title' => $subscription_title, '@state' => $subscription_state,