I've found a bug when the given IP address returns a GeoIpRecord but with the city field has a NULL value.
The error is: Fatal error: Uncaught TypeError: utf8_encode() expects parameter 1 to be string, null given in /var/www/sifo/vendor/geocoder-php/maxmind-binary-provider/MaxMindBinary.php on line 109.
Hi,
I've found a bug when the given IP address returns a
GeoIpRecord
but with thecity
field has a NULL value.The error is:
Fatal error: Uncaught TypeError: utf8_encode() expects parameter 1 to be string, null given in /var/www/sifo/vendor/geocoder-php/maxmind-binary-provider/MaxMindBinary.php on line 109
.(https://github.com/geocoder-php/Geocoder/blob/master/src/Provider/MaxMindBinary/MaxMindBinary.php#L109)
So, before applying the
utf8_encode
to thecity
orcountry_name
we should check if the value is null.