diff --git a/src/components/com_weblinks/src/View/Weblink/HtmlView.php b/src/components/com_weblinks/src/View/Weblink/HtmlView.php index 188070145d..6e6575df56 100644 --- a/src/components/com_weblinks/src/View/Weblink/HtmlView.php +++ b/src/components/com_weblinks/src/View/Weblink/HtmlView.php @@ -12,6 +12,7 @@ use Joomla\CMS\Event\Content; use Joomla\CMS\Factory; +use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\View\GenericDataException; use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView; use Joomla\CMS\Plugin\PluginHelper; @@ -71,6 +72,10 @@ public function display($tpl = null) $this->state = $model->getState(); $this->params = $this->state->get('params'); + if ($this->item === false) { + throw new \Exception(Text::_('COM_WEBLINKS_ERROR_WEBLINK_NOT_FOUND'), 404); + } + $errors = $model->getErrors(); if (\count($errors) > 0) {