Skip to content

Commit 200132d

Browse files
committed
set result = null on error
1 parent 7acb83d commit 200132d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/load.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ var Loader = function (data) {
324324
callback = typeof callback === 'function' ? callback : noop;
325325

326326
if (!options.path) {
327-
return callback(new Error('Path is not defined'));
327+
return callback(new Error('Path is not defined'), null);
328328
}
329329
if (fs.existsSync(options.path)) {
330-
return callback(new Error('Path ' + options.path + ' exists'));
330+
return callback(new Error('Path ' + options.path + ' exists'), null);
331331
}
332332

333333
process()
@@ -336,7 +336,7 @@ var Loader = function (data) {
336336
})
337337
.catch(function (e) {
338338
errorCleanup();
339-
return callback(e);
339+
return callback(e, null);
340340
});
341341
}
342342
}

0 commit comments

Comments
 (0)