MINOR FIX: instances where no SideBarID exists are now avoided

This commit is contained in:
Geoff Munn 2009-08-05 02:38:32 +00:00
parent 56be6ad6fa
commit acbce1d507
1 changed files with 5 additions and 2 deletions

View File

@ -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 -------------- */