Browse Source

using braces, whole nextTick conditioned

Herbert Vojčík 9 years ago
parent
commit
c782e1b59e
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 () {
-                    if (callback) callback.apply(null, deps);
-                });
+                if (callback) {
+                    process.nextTick(function () {
+                        callback.apply(null, deps);
+                    });
+                }
             }
         }