Skip to content

Commit

Permalink
Fix for null value in customer object (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
em411 authored Aug 3, 2021
1 parent be2d1cb commit dd8996d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Checker/Subscription/SubscriptionExpirationChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd8996d

Please sign in to comment.