From 56281b7f3e3ed5d38069a46351e91b4e22bbc5db Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Thu, 23 Jul 2009 00:54:40 +0000 Subject: [PATCH] MINOR prevent exceptions when the wrong object type is passed to LeftAndMain git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@82488 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/LeftAndMain.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/LeftAndMain.php b/code/LeftAndMain.php index 3ebea605..e9d057fd 100644 --- a/code/LeftAndMain.php +++ b/code/LeftAndMain.php @@ -864,7 +864,8 @@ if(node && node.parentTreeNode) node.parentTreeNode.removeTreeNode(node); $('Form_EditForm').closeIfSetTo($id); JS; FormResponse::add($response); - FormResponse::add($this->showSingleInstanceOnlyInCreateFieldJS($page)); + + if ($this instanceof LeftAndMain) FormResponse::add($this->showSingleInstanceOnlyInCreateFieldJS($page)); return FormResponse::respond(); }