Fixed php notice (merged from 2.1.0 branch, r41552)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42911 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-10-02 04:33:18 +00:00
parent e46e5e73c9
commit 7455457964

View File

@ -388,8 +388,11 @@ class Controller extends ViewableData {
array_unshift(self::$controller_stack, $this); array_unshift(self::$controller_stack, $this);
// Create a new session object // Create a new session object
if(!$this->session) { if(!$this->session) {
if(self::$controller_stack[1]) $this->session = self::$controller_stack[1]->getSession(); if(isset(self::$controller_stack[1])) {
else $this->session = new Session(null); $this->session = self::$controller_stack[1]->getSession();
} else {
$this->session = new Session(null);
}
} }
} }