BUGFIX Fixed potential non-object error in LeftAndMain::callPageMethod()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@76930 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-05-15 01:05:44 +00:00 committed by Sam Minnee
parent 6c3a3677fe
commit 6bdb807af1

View File

@ -779,6 +779,7 @@ JS;
$parentID = 0;
}
$_REQUEST['ajax'] = 1;
$cleanupJS = '';
if(is_numeric($id) && is_numeric($parentID) && $id != $parentID) {
$node = DataObject::get_by_id($this->stat('tree_class'), $id);
@ -1103,8 +1104,10 @@ JS;
*/
function callPageMethod($data, $form) {
$methodName = $form->buttonClicked()->extraData();
$record = $this->CurrentPage();
return $record->$methodName($data, $form);
$record = $this->currentPage();
if(!$record) return false;
return $record->$methodName($data, $form);
}
/**