From 8bc94c17ea9feda016f18ec38c4fcd2c7ac112a1 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 15:52:56 +0000 Subject: [PATCH] mlanthaler: Bugfix: "Notice: Trying to get property of non-object in..." (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@42102 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/model/PageView.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/model/PageView.php b/core/model/PageView.php index 07fee72d2..76f918241 100644 --- a/core/model/PageView.php +++ b/core/model/PageView.php @@ -80,7 +80,8 @@ class PageView extends DataObject { function setPageID() { $currentPage = Director::currentPage(); - $this->setField('PageID', $currentPage->ID); + if($currentPage) + $this->setField('PageID', $currentPage->ID); } function setIP() {