From 07a61a19a555ff806753f619d383d9f90a67cb1c Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sun, 2 Aug 2009 21:57:26 +0000 Subject: [PATCH] MINOR don't call TreeTitle on a node if it's being removed. git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@83452 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSBatchAction.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/CMSBatchAction.php b/code/CMSBatchAction.php index 8bc51d21..4c8ca127 100644 --- a/code/CMSBatchAction.php +++ b/code/CMSBatchAction.php @@ -45,8 +45,10 @@ abstract class CMSBatchAction extends Object { // Now make sure the tree title is appropriately updated $publishedRecord = DataObject::get_by_id('SiteTree', $page->ID); - $JS_title = Convert::raw2js($publishedRecord->TreeTitle()); - FormResponse::add("\$('sitetree').setNodeTitle($page->ID, '$JS_title');"); + if ($publishedRecord) { + $JS_title = Convert::raw2js($publishedRecord->TreeTitle()); + FormResponse::add("\$('sitetree').setNodeTitle($page->ID, '$JS_title');"); + } $page->destroy(); unset($page); }