Skip to content

Commit f6305ec

Browse files
author
Anna Bukatar
committed
MDVA-214: Port down MAGETWO-49004
- Fixed unit test errors
1 parent cdccfed commit f6305ec

File tree

1 file changed

+3
-2
lines changed
  • app/code/Magento/Catalog/Model/Layer/Filter/DataProvider

1 file changed

+3
-2
lines changed

app/code/Magento/Catalog/Model/Layer/Filter/DataProvider/Category.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ public function getCategory()
112112
/** @var CategoryModel|null $category */
113113
$category = null;
114114
if ($this->categoryId !== null) {
115-
if ($this->coreRegistry->registry('current_category')->getId() == $this->categoryId) {
116-
$category = $this->coreRegistry->registry('current_category');
115+
$currentCategory = $this->coreRegistry->registry('current_category');
116+
if ($currentCategory !== null && $currentCategory->getId() == $this->categoryId) {
117+
$category = $currentCategory;
117118
} else {
118119
$category = $this->categoryFactory->create()
119120
->setStoreId(

0 commit comments

Comments
 (0)