diff --git a/plugins/content/confirmconsent/fields/consentbox.php b/plugins/content/confirmconsent/fields/consentbox.php index 5c02d84e2197e..b8a34e379dc28 100644 --- a/plugins/content/confirmconsent/fields/consentbox.php +++ b/plugins/content/confirmconsent/fields/consentbox.php @@ -235,6 +235,15 @@ private function getAssignedArticleUrl() ); } + if (!is_object($article)) + { + // We have not found the article object lets show a 404 to the user + return Route::_( + 'index.php?option=com_content&view=article&id=' + . $this->articleid . '&tmpl=component' + ); + } + // Register ContentHelperRoute JLoader::register('ContentHelperRoute', JPATH_BASE . '/components/com_content/helpers/route.php');