Skip to content

Commit

Permalink
Fixed some logic
Browse files Browse the repository at this point in the history
  • Loading branch information
loevgaard committed Dec 3, 2024
1 parent fc05b68 commit f92110f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Model/WishlistItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Webmozart\Assert\Assert;

class WishlistItem implements WishlistItemInterface
{
Expand Down Expand Up @@ -55,9 +56,9 @@ public function setVariant(?ProductVariantInterface $variant): void

if (null !== $variant) {
$product = $variant->getProduct();
if ($product instanceof ProductInterface) {
$this->product = $product;
}
Assert::isInstanceOf($product, ProductInterface::class);

$this->product = $product;
}
}

Expand Down

0 comments on commit f92110f

Please sign in to comment.