BUGFIX: getParent() may return null. Prevent calling function on null (esp when running tests)

This commit is contained in:
Will Rossiter 2010-06-26 04:47:15 +00:00
parent 834b6d8f91
commit 20ad8dfbbc
1 changed files with 2 additions and 2 deletions

View File

@ -163,14 +163,14 @@ class BlogEntry extends Page {
* Link for editing this blog entry * Link for editing this blog entry
*/ */
function EditURL() { function EditURL() {
return $this->getParent()->Link('post') . '/' . $this->ID . '/'; return ($this->getParent()) ? $this->getParent()->Link('post') . '/' . $this->ID . '/' : false;
} }
/** /**
* Check to see if trackbacks are enabled. * Check to see if trackbacks are enabled.
*/ */
function TrackBacksEnabled() { function TrackBacksEnabled() {
return $this->getParent()->TrackBacksEnabled; return ($this->getParent()) ? $this->getParent()->TrackBacksEnabled : false;
} }
function trackbackping() { function trackbackping() {