diff --git a/app/models/user.py b/app/models/user.py index d38bfd5..b679d82 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -58,7 +58,8 @@ class User(UserMixin, db.Model): return None if game is None: return self.locations[-1] - return self.locations_during_game(game)[-1] + locations_during_game = self.locations_during_game(game) + return locations_during_game[-1] if locations_during_game else None def role_in_game(self, game): '''Returns the role as Role enum of player in given game. Returns None if player does not participate in game'''