fix: exception if no images
This commit is contained in:
@@ -70,7 +70,7 @@ class ProductsHandler
|
||||
);
|
||||
} catch (Exception $exception) {
|
||||
$this->logger->logException($exception);
|
||||
throw new RuntimeException('Error get product with id ' . $productId);
|
||||
throw new RuntimeException('Error get product with id ' . $productId, 500, $exception);
|
||||
}
|
||||
|
||||
return new JsonResponse([
|
||||
|
||||
@@ -238,7 +238,9 @@ class ProductsService
|
||||
->get();
|
||||
|
||||
$imagePaths = [];
|
||||
if ($product['product_image']) {
|
||||
$imagePaths[] = $product['product_image'];
|
||||
}
|
||||
foreach ($productsImages as $item) {
|
||||
$imagePaths[] = $item['image'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user