Skip to content

Commit

Permalink
fix(document): catch errors in required functions
Browse files Browse the repository at this point in the history
Fix #10968
  • Loading branch information
vkarpov15 committed Nov 19, 2021
1 parent 42ff338 commit 45a06e1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -2420,7 +2420,11 @@ function _evaluateRequiredFunctions(doc) {

if (p != null && typeof p.originalRequiredValue === 'function') {
doc.$__.cachedRequired = doc.$__.cachedRequired || {};
doc.$__.cachedRequired[path] = p.originalRequiredValue.call(doc, doc);
try {
doc.$__.cachedRequired[path] = p.originalRequiredValue.call(doc, doc);
} catch (err) {
doc.invalidate(path, err);
}
}
});
}
Expand Down

0 comments on commit 45a06e1

Please sign in to comment.