mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
BUGFIX: getParent() may return null. Prevent calling function on null (esp when running tests)
This commit is contained in:
parent
834b6d8f91
commit
20ad8dfbbc
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user