Skip to content

Commit 276d96f

Browse files
committed
Avoid DOMrange error
1 parent a883ad4 commit 276d96f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/client/autoform.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ AutoForm.addInputType("fileUpload", {
44

55
AutoForm._globalHooks.onSuccess.push(function (type) {
66
if (type === 'insert') {
7-
this.template.$('[data-reset-file]').click();
7+
try {
8+
if (this.template) {
9+
this.template.$('[data-reset-file]').click();
10+
}
11+
} catch (e) {}
812
}
913
});
1014

0 commit comments

Comments
 (0)