From 9cedd1a5e58fed68161755d14fad6544373ab2f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Fri, 25 Sep 2009 09:53:47 +0000
Subject: [PATCH] Fix for command line + sessionhandler php

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1788 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/SessionHandlerPHP.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/SimpleSAML/SessionHandlerPHP.php b/lib/SimpleSAML/SessionHandlerPHP.php
index 6a2eae69b..80dab6254 100644
--- a/lib/SimpleSAML/SessionHandlerPHP.php
+++ b/lib/SimpleSAML/SessionHandlerPHP.php
@@ -83,6 +83,7 @@ class SimpleSAML_SessionHandlerPHP extends SimpleSAML_SessionHandler {
 		/* Check if key exists first to avoid notice-messages in the
 		 * log.
 		 */
+		if (!isset($_SESSION)) return NULL;
 		if(!array_key_exists($key, $_SESSION)) {
 			/* We should return NULL if we don't have that
 			 * key in the session.
-- 
GitLab