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-23 15:28:26 +01:00 committed by Dan Poltawski
parent 7c52ee5027
commit ca4548c1c2

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;
}