Skip to content

Commit

Permalink
ensure readJSONSync properly throws read errors
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Nov 8, 2016
1 parent fd2990c commit 6159c91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ exports.readJSONSync = function(file) {
catch(e) {
if (e.code === 'ENOENT')
pjson = '{}';
else
throw e;
}
if (pjson.startsWith('\uFEFF'))
pjson = pjson.substr(1);
Expand Down

0 comments on commit 6159c91

Please sign in to comment.