handle case of player existing without historical data

This commit is contained in:
2020-09-27 10:50:50 +02:00
parent ce4fc872d2
commit 85192bb1d5

View File

@@ -52,7 +52,10 @@ class DatabaseConnection:
timestampDict.update({ "sigma" : r[SIGMA]})
playerIdDict.update({ r[TIMESTAMP] : timestampDict })
retDict = { rows[0][PLAYER_ID] : playerIdDict }
try:
retDict = { rows[0][PLAYER_ID] : playerIdDict }
except IndexError:
retDict = None
return retDict
def getPlayerById(self, playerId):