summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 21:36:04 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 21:36:04 (GMT)
commit87243de90ff72864647c0d06be3f62e45f08be1e (patch)
treee6740efc01b90b87043985d6dd9abed0d2c09383
parent05f73d45f212859b9f99554813828c09277ba7ad (diff)
Servertable.__unicode__ is now more robust, also works for empty table
-rw-r--r--src/servertable.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/servertable.py b/src/servertable.py
index e699555..1ae3806 100644
--- a/src/servertable.py
+++ b/src/servertable.py
@@ -201,8 +201,11 @@ class ServerTable(Table):
def __unicode__(self):
"""for debugging output"""
- onlineNames = list(x.name + (u'(Owner)' if x == self.owner.name else u'')
- for x in self.users)
+ if self.users:
+ onlineNames = list(x.name + (u'(Owner)' if self.owner and x == self.owner.name else u'')
+ for x in self.users)
+ else:
+ onlineNames = list(['no users yet'])
offlineString = u''
if self.game:
offlineNames = list(x.name for x in self.game.players if x.name not in onlineNames