From 2d05b4f07adf290357e8d426e43d4dcc907e18ae Mon Sep 17 00:00:00 2001 From: JabLuszko Date: Sun, 15 Sep 2024 22:42:00 +0200 Subject: [PATCH] 'NoneType' object has no attribute 'timestamp' --- mapadroid/db/DbWebhookReader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mapadroid/db/DbWebhookReader.py b/mapadroid/db/DbWebhookReader.py index b980d6bb9..2689cfeb0 100644 --- a/mapadroid/db/DbWebhookReader.py +++ b/mapadroid/db/DbWebhookReader.py @@ -209,9 +209,9 @@ async def get_stations_changed_since(session: AsyncSession, _timestamp: int): ret.append({ "station_id": station.station_id, "battle_level": station.battle_level, - "battle_spawn": int(station.battle_spawn.timestamp()), - "battle_start": int(station.battle_window_start.timestamp()), - "battle_end": int(station.battle_window_end.timestamp()), + "battle_spawn": int(station.battle_spawn.timestamp()) if station.battle_spawn else None, + "battle_start": int(station.battle_window_start.timestamp()) if station.battle_window_start else None, + "battle_end": int(station.battle_window_end.timestamp()) if station.battle_window_end else None, "battle_pokemon_move_1": station.battle_pokemon_move_1, "battle_pokemon_move_2": station.battle_pokemon_move_2, "battle_pokemon_bread_mode": station.battle_pokemon_bread_mode,