From 7082672817807285e2d961bda9c9d0ea99e94fd6 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Wed, 18 Nov 2009 08:14:44 +0000 Subject: [PATCH] Auth_State: Make loadExceptionState return NULL if no exception was passed to the current page. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1995 44740490-163a-0410-bde0-09ae8108e29a --- lib/SimpleSAML/Auth/State.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/SimpleSAML/Auth/State.php b/lib/SimpleSAML/Auth/State.php index 32afe3620..1fc117c6d 100644 --- a/lib/SimpleSAML/Auth/State.php +++ b/lib/SimpleSAML/Auth/State.php @@ -245,13 +245,16 @@ class SimpleSAML_Auth_State { * Retrieve an exception state. * * @param string|NULL $id The exception id. Can be NULL, in which case it will be retrieved from the request. - * @return array The state array with the exception. + * @return array|NULL The state array with the exception, or NULL if no exception was thrown. */ public static function loadExceptionState($id = NULL) { assert('is_string($id) || is_null($id)'); if ($id === NULL) { - assert('array_key_exists(self::EXCEPTION_PARAM, $_REQUEST)'); + if (!array_key_exists(self::EXCEPTION_PARAM, $_REQUEST)) { + /* No exception. */ + return NULL; + } $id = $_REQUEST[self::EXCEPTION_PARAM]; } -- GitLab