fix: error when category doesnt have image
This commit is contained in:
@@ -53,7 +53,7 @@ class CategoriesHandler
|
||||
'data' => array_map(static function ($category) {
|
||||
return [
|
||||
'id' => (int)$category['id'],
|
||||
'image' => $category['image'],
|
||||
'image' => $category['image'] ?? '',
|
||||
'name' => $category['name'],
|
||||
'description' => $category['description'],
|
||||
'children' => $category['children'],
|
||||
@@ -72,7 +72,7 @@ class CategoriesHandler
|
||||
$category['children'] = $children;
|
||||
}
|
||||
|
||||
$image = $this->ocImageTool->resize($category['image'], self::THUMB_SIZE, self::THUMB_SIZE, 'no_image.png');
|
||||
$image = $this->ocImageTool->resize($category['image'] ?? '', self::THUMB_SIZE, self::THUMB_SIZE, 'no_image.png');
|
||||
|
||||
$branch[] = [
|
||||
'id' => (int)$category['id'],
|
||||
|
||||
Reference in New Issue
Block a user