From f23655ffc395ec468fdf131f8aa31a34b482181e Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 30 Apr 2019 12:55:40 -0700 Subject: [PATCH] fix: handle an empty geoip whitelist file --- api/api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/api.js b/api/api.js index 0103abce..76321c33 100644 --- a/api/api.js +++ b/api/api.js @@ -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); }