Skip to content

Commit

Permalink
Merge pull request #76 from Roxayl/bugfix/null-category-returned
Browse files Browse the repository at this point in the history
Return early if no nested categories retrieved
  • Loading branch information
Hlavtox authored Nov 6, 2024
2 parents 1171475 + 23abf26 commit ed7ca6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ps_categorytree.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ private function getCategories($category): array

// Retrieve them using the built in method
$categories = Category::getNestedCategories($category->id, $this->context->language->id, true, $groups, true, $sqlFilter, $orderBy);
if (empty($categories)) {
return [];
}

// Get path to current category so we can use it for marking
$idsOfCategoriesInPath = $this->getIdsOfCategoriesInPathToCurrentCategory();
Expand Down

0 comments on commit ed7ca6d

Please sign in to comment.