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.
This commit is contained in:
Andrew Robert Nicols
2012-07-24 14:28:14 +01:00
parent 3294034b80
commit 10f2c0fb49
+1 -1
View File
@@ -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;
}