Fix KeyError : geo attribute can not exists

This commit is contained in:
Gregory Soutade 2017-08-23 20:10:15 +02:00
parent 83227cfad2
commit 3b3ae1ea3e
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class IWLADisplayTopGeo(IPlugin):
def hook(self):
display = self.iwla.getDisplay()
geo = self.iwla.getMonthStats()['geo']
geo = self.iwla.getMonthStats().get('geo', {})
geo = sorted(geo.items(), key=lambda t: t[1], reverse=True)
self.valid_visitors = self.iwla.getValidVisitors()