Skip to content

Commit ac617b7

Browse files
author
Paul Hendry
committed
Fix define-without-callback support
Relates to #158 The previous fix inadvertently changed the control flow, causing a falsy `callback` to trigger the error handling even if no errors occurred.
1 parent 3ce314d commit ac617b7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

runtime/DojoAMDMainTemplate.runtime.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ module.exports = {
132132
errors.push({mid: mid, error: e});
133133
}
134134
});
135-
if (callback && errors.length === 0) {
136-
callback.apply(this, modules);
135+
if (errors.length === 0) {
136+
if (callback) {
137+
callback.apply(this, modules);
138+
}
137139
} else {
138140
var error = new Error("findModules");
139141
error.src = "dojo-webpack-plugin";

0 commit comments

Comments
 (0)