Skip to content

Commit 61f847e

Browse files
Add null check for admin session user
1 parent 207a449 commit 61f847e

File tree

1 file changed

+8
-3
lines changed
  • app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier

1 file changed

+8
-3
lines changed

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Categories.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,11 +379,16 @@ protected function getCategoriesTree($filter = null)
379379
* @param string $filter
380380
* @return string
381381
*/
382-
private function getCategoriesTreeCacheId(int $storeId, string $filter = '') : string
382+
private function getCategoriesTreeCacheId(int $storeId, string $filter = ''): string
383383
{
384+
if ($this->session->getUser() !== null) {
385+
return self::CATEGORY_TREE_ID
386+
. '_' . (string)$storeId
387+
. '_' . $this->session->getUser()->getAclRole()
388+
. '_' . $filter;
389+
}
384390
return self::CATEGORY_TREE_ID
385-
. '_' . (string) $storeId
386-
. '_' . $this->session->getUser()->getAclRole()
391+
. '_' . (string)$storeId
387392
. '_' . $filter;
388393
}
389394

0 commit comments

Comments
 (0)