Skip to content

Commit

Permalink
BUGFIX Check for form object before calling observe() on the element.…
Browse files Browse the repository at this point in the history
… The CheckBoxRange constructor allows for a null form, so a check for a form object is essential.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@70046 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sean Harvey authored and Sam Minnee committed Feb 2, 2011
1 parent 6b5cab8 commit aeeb7bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions javascript/AssetAdmin.js
Expand Up @@ -102,8 +102,10 @@ CheckBoxRange.prototype = {
this.form = form;
this.field = field;
this.eventPossibleCheckHappened = this.possibleCheckHappened.bindAsEventListener(this);
Event.observe(form, "click", this.eventPossibleCheckHappened);
Event.observe(form, "keyup", this.eventPossibleCheckHappened);
if(form) {
Event.observe(form, "click", this.eventPossibleCheckHappened);
Event.observe(form, "keyup", this.eventPossibleCheckHappened);
}
},

possibleCheckHappened: function(event) {
Expand Down

0 comments on commit aeeb7bb

Please sign in to comment.