From 69ca614fa4272a60fae291055bccc2bb055e4c0d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 3 Aug 2010 03:36:44 +0000 Subject: [PATCH] BUGFIX Checking for existence of $('SwitchView') (fixes #5282) (from r108436) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@108828 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index 54dd9314..ec6e23d8 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -392,9 +392,10 @@ var ss_MainLayout; $('#Form_EditForm').bind('load delete', function(e) { var updatedSwitchView = $('#AjaxSwitchView'); - console.debug(updatedSwitchView.html()); - $('#SwitchView').html(updatedSwitchView.html()); - updatedSwitchView.remove(); + if(updatedSwitchView.length) { + $('#SwitchView').html(updatedSwitchView.html()); + updatedSwitchView.remove(); + } }); } });