Merge pull request #859 from jitendra-webkul/jitendra

Issue #851 fixed
This commit is contained in:
Jitendra Singh 2019-04-23 11:17:25 +05:30 committed by GitHub
commit adfc375091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -52,12 +52,9 @@ class ProductImage extends AbstractProduct
*/
public function getProductBaseImage($product)
{
if (! $product)
return [];
$images = $product->images;
$images = $product ? $product->images : null;
if ($images->count()) {
if ($images && $images->count()) {
$image = [
'small_image_url' => url('cache/small/' . $images[0]->path),
'medium_image_url' => url('cache/medium/' . $images[0]->path),