-
Notifications
You must be signed in to change notification settings - Fork 290
Fix City constructor from empty subdivisions #290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes error: ```Cannot assign null to property GeoIp2\Model\City::$mostSpecificSubdivision of type GeoIp2\Record\Subdivision``` Which happens for example for IP from Hongkong.
|
In which database did you see this? It seems unexpected to have records that would hit this. |
|
It is on GeoIP City Database |
|
I see. Is it a database from MaxMind? Do you know what the date of the database is? You could use the mmdbinspect tool to get this information: https://github.com/maxmind/mmdbinspect Run it like: Would you be able to share the output from that please? And the filename you run it on? Thank you for your patience and help! I am not opposed to merging the change, but I'm hoping to understand if there's an issue with the database itself. So far I have not been able to see any empty subdivisions myself. |
|
Here is the output of the inspect tool for these example problematic IPs:
|
|
Thank you! So it looks like that database isn't one from MaxMind. We can merge this change, but it would also be good if you could ask the provider to see if they could update their databases to omit empty subdivisions if they're expecting people to use this library with it. |
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Update changelog to mention #290
Fixes error:
Cannot assign null to property GeoIp2\Model\City::$mostSpecificSubdivision of type GeoIp2\Record\SubdivisionWhich happens for example for IP from Hongkong.