Skip to content

Commit 9f21fed

Browse files
committed
handle case when regExp is false in context
1 parent 9a2f74f commit 9f21fed

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎lib/ContextModuleFactory.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ ContextModuleFactory.prototype.create = function(context, dependency, callback)
7373
};
7474

7575
ContextModuleFactory.prototype.resolveDependencies = function resolveDependencies(fs, resource, recursive, regExp, callback) {
76+
if(!regExp || !resource)
77+
return callback(null, []);
7678
(function addDirectory(directory, callback) {
7779
fs.readdir(directory, function(err, files) {
7880
if(!files || files.length === 0) return callback(null, []);

0 commit comments

Comments
 (0)