FIX: Fixes CMS errors when viewing history on "Deleted" pages.

Fixes undocumented error when viewing history tab of deleted pages with no history.
Related to silverstripe/silverstripe/cms#1054 (See
silverstripe/silverstripe-cms/pull/1149).
This commit is contained in:
Russell Michell 2015-01-09 11:16:00 +13:00
parent 146b4689b8
commit adf0f102cc

View File

@ -1249,8 +1249,11 @@ class Versioned extends DataExtension implements TemplateGlobalProvider {
*/
public function isLatestVersion() {
$version = self::get_latest_version($this->owner->class, $this->owner->ID);
if($version) {
return ($version->Version == $this->owner->Version);
}
return ($version->Version == $this->owner->Version);
return false;
}
/**