Browse Source

Merge pull request #26 from herby/patch-1

Fix the error in case of no-cb `require(["deps"])`
James Burke 9 years ago
parent
commit
dbc2d67230
1 changed files with 5 additions and 3 deletions
  1. 5 3
      amdefine.js

+ 5 - 3
amdefine.js

@@ -120,9 +120,11 @@ function amdefine(module, requireFn) {
                 });
 
                 //Wait for next tick to call back the require call.
-                process.nextTick(function () {
-                    callback.apply(null, deps);
-                });
+                if (callback) {
+                    process.nextTick(function () {
+                        callback.apply(null, deps);
+                    });
+                }
             }
         }