Skip to content
This repository has been archived by the owner on Jul 22, 2020. It is now read-only.

Commit

Permalink
fix: handle an empty geoip whitelist file
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Apr 30, 2019
1 parent 8c14aa4 commit f23655f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ if (fs.existsSync(geoipWhitelistFile)) {
geoipWhitelist,
);
assert(typeof geoipWhitelist === 'object');
if (geoipWhitelist === null) {
geoipWhitelist = {};
}
} catch (err) {
console.log(`Failed to process ${geoipWhitelistFile}:`, err);
}
Expand Down

0 comments on commit f23655f

Please sign in to comment.