diff --git a/CHANGELOG.md b/CHANGELOG.md index 9223d23..38ada84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +v2.1.0 +------ + +- Fix: CartBuilder fix call to member function getPath() on null + v2.0.0 ------ diff --git a/composer.json b/composer.json index d87c232..6119996 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "alma/sylius-payment-plugin", "type": "sylius-plugin", + "version": "2.1.0", "keywords": [ "alma", "buy now pay later", diff --git a/src/AlmaSyliusPaymentPlugin.php b/src/AlmaSyliusPaymentPlugin.php index 8b152a2..d48a05c 100644 --- a/src/AlmaSyliusPaymentPlugin.php +++ b/src/AlmaSyliusPaymentPlugin.php @@ -11,7 +11,7 @@ final class AlmaSyliusPaymentPlugin extends Bundle { - const VERSION = "2.0.0"; + const VERSION = "2.1.0"; use SyliusPluginTrait; diff --git a/src/DataBuilder/CartDataBuilder.php b/src/DataBuilder/CartDataBuilder.php index 63f4b53..748fa21 100644 --- a/src/DataBuilder/CartDataBuilder.php +++ b/src/DataBuilder/CartDataBuilder.php @@ -158,9 +158,9 @@ private function getProductPictureUrl(ProductVariantInterface $variant): string /** @var ImageInterface[] $images */ $images = $subject->getImages(); - if (count($mainPictures) > 0) { + if (!empty($mainPictures) && $mainPictures[0] !== null ) { $path = $mainPictures[0]->getPath(); - } elseif (count($images) > 0) { + } elseif (!empty($images) && $images[0] !== null) { $path = $images[0]->getPath(); }