Skip to content

Commit

Permalink
Merge pull request #2784 from justcarakas/fix-error-when-there-is-no-…
Browse files Browse the repository at this point in the history
…category-slug

Fix error when there is no category slug
  • Loading branch information
carakas committed May 8, 2019
2 parents f6aa98d + 7bdd754 commit bf88261
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Frontend/Modules/Blog/Actions/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ public function execute(): void

private function getCategory(): array
{
$category = FrontendBlogModel::getCategory($this->url->getParameter(1));
$slug = $this->url->getParameter(1);
if (empty($slug)) {
throw new NotFoundHttpException();
}

$category = FrontendBlogModel::getCategory($slug);

if (empty($category)) {
throw new NotFoundHttpException();
Expand Down

0 comments on commit bf88261

Please sign in to comment.