diff --git a/src/Core/Api/Transaction/Service/TransactionService.php b/src/Core/Api/Transaction/Service/TransactionService.php index edb7f35..46128bd 100644 --- a/src/Core/Api/Transaction/Service/TransactionService.php +++ b/src/Core/Api/Transaction/Service/TransactionService.php @@ -310,7 +310,9 @@ private function holdDelivery(string $orderId, Context $context) */ $orderEntity = $this->getOrderEntity($orderId, $context); $orderDeliveryStateHandler = $this->container->get(OrderDeliveryStateHandler::class); - $orderDeliveryStateHandler->hold($orderEntity->getDeliveries()->last()->getId(), $context); + if (null !== $orderEntity->getDeliveries()->last()) { + $orderDeliveryStateHandler->hold($orderEntity->getDeliveries()->last()->getId(), $context); + } } catch (\Exception $exception) { $this->logger->critical($exception->getTraceAsString()); }