Skip to content

Commit

Permalink
Merge pull request #113 from SilverStripers/fix/php8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Feb 28, 2023
2 parents 9ebd9b6 + 6949113 commit 7db1e34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/Constraints/CodeDiscountConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public function filter(DataList $list)

public function check(Discount $discount)
{
$code = strtolower($this->findCouponCode());
$code = strtolower($this->findCouponCode() ?? '');

if ($discount->Code && ($code !== strtolower($discount->Code))) {
if ($discount->Code && ($code !== strtolower($discount->Code ?? ''))) {
$this->error("Coupon code doesn't match $code");
return false;
}
Expand Down

0 comments on commit 7db1e34

Please sign in to comment.