Permalink
Browse files

MDL-34433 Check for existence of e and e.target in set_form_changed

This is required for cases when code directly calls set_form_changed as
happens with the filepicker.
  • Loading branch information...
andrewnicols authored and danpoltawski committed Jul 23, 2012
1 parent 7c52ee5 commit ca4548c1c2c178935fe5e9c7e737b8473319889d
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/yui/formchangechecker/formchangechecker.js
@@ -93,7 +93,7 @@ YUI.add('moodle-core-formchangechecker',
* Set the form changed state to true
*/
M.core_formchangechecker.set_form_changed = function(e) {
- if (e.target.hasClass('ignoredirty')) {
+ if (e && e.target && e.target.hasClass('ignoredirty')) {
// Don't warn on elements with the ignoredirty class
return;
}

0 comments on commit ca4548c

Please sign in to comment.