diff --git a/vendor/magento/module-inventory-reservation-cli/Command/Input/GetReservationFromCompensationArgument.php b/vendor/magento/module-inventory-reservation-cli/Command/Input/GetReservationFromCompensationArgument.php index 3d5731f9675f..c0fff5b86b47 100644 --- a/vendor/magento/module-inventory-reservation-cli/Command/Input/GetReservationFromCompensationArgument.php +++ b/vendor/magento/module-inventory-reservation-cli/Command/Input/GetReservationFromCompensationArgument.php @@ -93,6 +93,12 @@ public function execute(string $argument): ReservationInterface ); $order = current($results->getItems()); + if (!$order) { + throw new InvalidArgumentException( + sprintf('Order with increment id "%s" does not exist.', $argumentParts['increment_id']) + ); + } + return $this->reservationBuilder ->setSku((string)$argumentParts['sku']) ->setQuantity((float)$argumentParts['quantity'])