Permalink
Browse files

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
  • Loading branch information...
1 parent 2143443 commit 69ca614fa4272a60fae291055bccc2bb055e4c0d @chillu chillu committed Aug 3, 2010
Showing with 4 additions and 3 deletions.
  1. +4 −3 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();
+ }
});
}
});

0 comments on commit 69ca614

Please sign in to comment.