Commit aa3f4ce4 by William Tisäter

Catch invalid seeks

parent ad1f235f
...@@ -273,7 +273,7 @@ class GeoIP(object): ...@@ -273,7 +273,7 @@ class GeoIP(object):
@rtype: str @rtype: str
""" """
seek_org = self._seek_country(ipnum) seek_org = self._seek_country(ipnum)
if not seek_org: if seek_org == self._databaseSegments:
return None return None
read_length = (2 * self._recordLength - 1) * self._databaseSegments read_length = (2 * self._recordLength - 1) * self._databaseSegments
...@@ -345,7 +345,7 @@ class GeoIP(object): ...@@ -345,7 +345,7 @@ class GeoIP(object):
@rtype: dict @rtype: dict
""" """
seek_country = self._seek_country(ipnum) seek_country = self._seek_country(ipnum)
if not seek_country: if seek_country == self._databaseSegments:
return {} return {}
read_length = (2 * self._recordLength - 1) * self._databaseSegments read_length = (2 * self._recordLength - 1) * self._databaseSegments
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment