Skip to content

Commit 5a3918e

Browse files
committed
Bug fix with snapshots
1 parent 7b6afb8 commit 5a3918e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

watcher/jobs/snapshots.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ async def take_player_snapshot():
1212
player_sessions = [
1313
session for session in sessions if session.player == player.id
1414
]
15-
player_town = [town for town in towns if town.id == player.town][0]
15+
player_town = [town for town in towns if town.id == player.town]
16+
player_town = player_town[0] if player_town else None
1617

18+
# TODO: Get rid of storing entire sessions as it is unnecessary
1719
sessions_dict = {}
1820
for session in player_sessions:
1921
sessions_dict[str(session.id)] = {

0 commit comments

Comments
 (0)