diff --git a/docs/en/index.rst b/docs/en/index.rst index 58e148b2..dd65787c 100644 --- a/docs/en/index.rst +++ b/docs/en/index.rst @@ -165,7 +165,7 @@ like:: { $result = $this->Authentication->getResult(); // If the user is logged in send them away. - if ($result->isValid()) { + if ($result && $result->isValid()) { $target = $this->Authentication->getLoginRedirect() ?? '/home'; return $this->redirect($target); }