From d60fc2fdce2b062e71b192efaf8402959c38101c Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Fri, 4 Sep 2009 01:18:07 +0000 Subject: [PATCH] BUGFIX: moved $versionAuthor variable invocation into a check for the existence of the $record variable on which it depends (Ticket #4458) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85713 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSMain.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/CMSMain.php b/code/CMSMain.php index d224c0f1..4cd99d44 100644 --- a/code/CMSMain.php +++ b/code/CMSMain.php @@ -755,8 +755,7 @@ JS; $id = $this->urlParams['ID']; $version = str_replace('&ajax=1','',$this->urlParams['OtherID']); $record = Versioned::get_version("SiteTree", $id, $version); - $versionAuthor = DataObject::get_by_id('Member', $record->AuthorID); - + if($record) { if($record && !$record->canView()) return Security::permissionFailure($this); @@ -765,6 +764,8 @@ JS; $fields->push(new HiddenField("ID")); $fields->push(new HiddenField("Version")); + + $versionAuthor = DataObject::get_by_id('Member', $record->AuthorID); $fields->insertBefore( new LiteralField( 'YouAreViewingHeader',