]> git.ipfire.org Git - people/shoehn/ipfire.org.git/commitdiff
geoip: Don't lookup "nothing" in the database.
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 5 Jan 2013 13:21:04 +0000 (14:21 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 5 Jan 2013 13:21:04 +0000 (14:21 +0100)
www/webapp/backend/geoip.py

index 767488b06363dc633a51b5af502b209332bbc485..43f92da3acf57d59dff1b65eaa7ca489f3973327 100644 (file)
@@ -44,6 +44,8 @@ class GeoIP(object):
 
        def get_all(self, addr):
                addr = self._encode_ip(addr)
+               if not addr:
+                       return
 
                ret = self.db.get("SELECT locations.* FROM addresses \
                        JOIN locations ON locations.id = addresses.location \