From 78ee5b5d30c4245522ca9affb2e5a31eb4d42769 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Fri, 20 Jul 2007 02:17:40 +0000 Subject: [PATCH] Fixed php warning git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39064 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/SiteTree.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php index b105b5c44..954c576a6 100644 --- a/core/model/SiteTree.php +++ b/core/model/SiteTree.php @@ -158,8 +158,8 @@ class SiteTree extends DataObject { */ protected function prepareCurrentAndSection() { if(!self::$currentPageID) { - self::$currentPageID = Director::currentPage()->ID; - if(!self::$currentPageID) { + self::$currentPageID = Director::currentPage() ? Director::currentPage()->ID : null; + if(!isset(self::$currentPageID)) { self::$currentPageID = -1; $nextID = isset(Director::currentPage()->Parent->ID) ? Director::currentPage()->Parent->ID : null; } else {