Fix error when creating new redirector page

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.1.0@41673 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-09-13 23:04:03 +00:00 committed by Sam Minnee
parent d7f2aba95a
commit ab1633fb67

View File

@ -36,7 +36,7 @@ class RedirectorPage extends Page {
if($this->RedirectionType == 'External') { if($this->RedirectionType == 'External') {
return $this->ExternalURL; return $this->ExternalURL;
} else { } else {
$linkTo = DataObject::get_by_id("SiteTree", $this->LinkToID); $linkTo = $this->LinkToID ? DataObject::get_by_id("SiteTree", $this->LinkToID) : null;
if($linkTo) { if($linkTo) {
return $linkTo->Link(); return $linkTo->Link();
} }