From acbce1d50781e1a07a9496247bc9502b15eec3f4 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Wed, 5 Aug 2009 02:38:32 +0000 Subject: [PATCH] MINOR FIX: instances where no SideBarID exists are now avoided --- code/BlogTree.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/BlogTree.php b/code/BlogTree.php index 74a608c..06871ee 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -82,8 +82,11 @@ class BlogTree extends Page { if ($this->InheritSideBar && $this->getParent()) { if (method_exists($this->getParent(), 'SideBar')) return $this->getParent()->SideBar(); } - return DataObject::get_by_id('WidgetArea', $this->SideBarID); - // @todo: This segfaults - investigate why then fix: return $this->getComponent('SideBar'); + + if($this->SideBarID){ + return DataObject::get_by_id('WidgetArea', $this->SideBarID); + // @todo: This segfaults - investigate why then fix: return $this->getComponent('SideBar'); + } } /* ----------- CMS CONTROL -------------- */