From 3a23d009081e7018f7b96d09d75482db5a62cead Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 13 Feb 2025 15:40:50 +1300 Subject: [PATCH] ENH Stop using Controller::has_curr() --- src/RealMeService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/RealMeService.php b/src/RealMeService.php index 347edca..6d626e9 100644 --- a/src/RealMeService.php +++ b/src/RealMeService.php @@ -468,8 +468,9 @@ public function enforceLogin(HTTPRequest $request, $backUrl = null) // If not, attempt to retrieve authentication data from OneLogin (in case this is called during SAML assertion) try { - if (!$session->get("RealMeErrorBackURL") && Controller::has_curr()) { - $session->set("RealMeErrorBackURL", Controller::curr()->Link("Login")); + $controller = Controller::curr(); + if (!$session->get("RealMeErrorBackURL") && $controller) { + $session->set("RealMeErrorBackURL", $controller->Link("Login")); } $auth = $this->getAuth();