Fixed php warning

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@39064 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-07-20 02:17:40 +00:00
parent 32995ceadc
commit 78ee5b5d30
1 changed files with 2 additions and 2 deletions

View File

@ -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 {