Skip to content

Commit

Permalink
Try-catch around statSync
Browse files Browse the repository at this point in the history
  • Loading branch information
frostney committed Mar 1, 2016
1 parent 97c0fbb commit dc02c46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export default function localResolver() {
const dirIndexFile = path.join(directory + importee, 'index.js');

// TODO: This should be asynchronous
const stats = statSync(dirIndexFile);
let stats;

try {
stats = statSync(dirIndexFile);
} catch (e) {
return null;
}

if (stats.isFile()) {
return dirIndexFile;
Expand Down

0 comments on commit dc02c46

Please sign in to comment.