Skip to content

Commit

Permalink
Fixed issue with missing iso_code
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry Nedry authored and Larry Nedry committed Dec 22, 2017
1 parent 5cb2e4c commit efc36d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ exports.received_headers = function (connection) {
if (net_utils.is_private_ip(match[1])) continue; // exclude private IP

const gi = plugin.get_geoip(match[1]);
const country = gi ? (gi.country.iso_code) : '';
const country = (gi && gi.country && gi.country.iso_code) ? (gi.country.iso_code) : '';
let logmsg = `received=${match[1]}`;
if (country) {
logmsg += ` country=${country}`;
Expand Down

0 comments on commit efc36d4

Please sign in to comment.