From dd8996dedb5f41f1d2e093af283c5d06da68269c Mon Sep 17 00:00:00 2001 From: Emil <7682404+em411@users.noreply.github.com> Date: Tue, 3 Aug 2021 11:10:34 +0200 Subject: [PATCH] Fix for null value in customer object (#6) --- src/Checker/Subscription/SubscriptionExpirationChecker.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Checker/Subscription/SubscriptionExpirationChecker.php b/src/Checker/Subscription/SubscriptionExpirationChecker.php index 8e3f947..76b07cf 100644 --- a/src/Checker/Subscription/SubscriptionExpirationChecker.php +++ b/src/Checker/Subscription/SubscriptionExpirationChecker.php @@ -33,6 +33,10 @@ public function __construct(ShippingSubscriptionRepositoryInterface $customerRep */ public function checkSubscription(SubscriptionAwareInterface $customer): bool { + if (null === $customer->getId()) { + return false; + } + $subscription = $this->customerRepository->findActiveSubscription($customer); return $subscription instanceof ShippingSubscriptionInterface;