Fix nil ip issue

Improve the handling of ip address to country codes with an blacklist style invalid addresses array for GeoIP encoding