diff --git a/components/com_search/controller.php b/components/com_search/controller.php index 46785cfa06124..36a83bad03fd8 100644 --- a/components/com_search/controller.php +++ b/components/com_search/controller.php @@ -86,7 +86,7 @@ public function search() $item = $menu->getItem($post['Itemid']); // The requested Item is not a search page so we need to find one - if (!empty($item) && ($item->component != 'com_search' || $item->query['view'] != 'search')) + if ($item && ($item->component != 'com_search' || $item->query['view'] != 'search')) { // Get item based on component, not link. link is not reliable. $item = $menu->getItems('component', 'com_search', true);