node-maxmind-db icon indicating copy to clipboard operation
node-maxmind-db copied to clipboard

crash app when ip is invalid

Open truonghoangnguyen opened this issue 9 years ago • 2 comments

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

truonghoangnguyen avatar Feb 22 '16 07:02 truonghoangnguyen

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.

chriskinsman avatar Jan 17 '17 17:01 chriskinsman

https://github.com/runk/node-maxmind

knoxcard avatar Dec 28 '18 05:12 knoxcard