Skip to content

Commit e528c3b

Browse files
authored
Merge pull request #42 from mrauhu/autoform-validation-context
Fix: veliovgroup/Meteor-Files#263 and partial fixes #5
2 parents e96e8f8 + 77632bf commit e528c3b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/client/fileUpload.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ Template.afFileUpload.events({
9999
});
100100

101101
const upload = template.collection.insert(opts, false);
102-
const ctx = AutoForm.getValidationContext(template.formId);
102+
let ctx;
103+
try {
104+
ctx = AutoForm.getValidationContext(template.formId);
105+
} catch (e) {
106+
// Fix: "TypeError: Cannot read property '_resolvedSchema' of undefined"
107+
ctx = AutoForm.getValidationContext();
108+
}
103109

104110
upload.on('start', function () {
105111
ctx.reset();

0 commit comments

Comments
 (0)