diff --git a/src/LanguageSwitch.php b/src/LanguageSwitch.php index a2666ef..1123f0d 100755 --- a/src/LanguageSwitch.php +++ b/src/LanguageSwitch.php @@ -233,7 +233,7 @@ public function isVisibleInsidePanels(): bool public function isVisibleOutsidePanels(): bool { return (bool) ($this->evaluate($this->visibleOutsidePanels) - && str(request()->route()->getName())->contains($this->outsidePanelRoutes) + && str(request()->route()?->getName())->contains($this->outsidePanelRoutes) && $this->isCurrentPanelIncluded()); }