Skip to content

Commit

Permalink
Display 404 page if banner not found (#20664)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quy authored and Michael Babker committed Jun 12, 2018
1 parent cfb6028 commit eedb57b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/com_banners/models/banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class BannersModelBanner extends JModelLegacy
*/
public function click()
{
$item = $this->getItem();

if (empty($item))
{
throw new Exception(JText::_('JERROR_PAGE_NOT_FOUND'), 404);
}

$id = $this->getState('banner.id');

// Update click count
Expand All @@ -55,8 +62,6 @@ public function click()
JError::raiseError(500, $e->getMessage());
}

$item = $this->getItem();

// Track clicks
$trackClicks = $item->track_clicks;

Expand Down

0 comments on commit eedb57b

Please sign in to comment.