Skip to content

Commit 79c54ae

Browse files
committed
#29174 Fix unit tests
1 parent 3361e72 commit 79c54ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/Catalog/Model/CategoryRepository.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
namespace Magento\Catalog\Model;
99

10+
use Magento\Catalog\Api\Data\CategoryInterface;
1011
use Magento\Framework\Exception\CouldNotSaveException;
1112
use Magento\Framework\Exception\NoSuchEntityException;
1213
use Magento\Framework\Exception\StateException;
13-
use Magento\Catalog\Api\Data\CategoryInterface;
1414

1515
/**
1616
* Repository for categories.
@@ -82,7 +82,9 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
8282
$existingData = array_diff_key($existingData, array_flip(['path', 'level', 'parent_id']));
8383
$existingData['store_id'] = $storeId;
8484

85-
$existingData = array_replace($existingData, $category->getData());
85+
if (is_array($category->getData())) {
86+
$existingData = array_replace($existingData, $category->getData());
87+
}
8688

8789
if ($category->getId()) {
8890
$metadata = $this->getMetadataPool()->getMetadata(

0 commit comments

Comments
 (0)