node-maxmind-db
node-maxmind-db copied to clipboard
crash app when ip is invalid
I used sailsjs and node-maxmind-db, when ip is invalid, app is crash code in coffee:
ip = '113.183.205.64,66.249.82.67';
mmdbreader.open GEOPATH, (error, countries) ->
countries.getGeoData ip, (error, geodata) ->
if error
sails.log.error 'expected come here'
return callback true, MessageService.common.system(error)
sails.log.error geodata
thanks
We are seeing this also. Instead of calling the callback with an error we instead get a crash.
In our case we were passing 'undefined' as the IP accidentally and it crashed the process due to no out try/catch block.
https://github.com/runk/node-maxmind