From 9ed6e786e61ca0ccffa2be8493f6800f4de04eff Mon Sep 17 00:00:00 2001 From: norohind <60548839+norohind@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:46:26 +0300 Subject: [PATCH] DB: fix last_known_squadron for *cold* start --- DB.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DB.py b/DB.py index d460b9c..59a5c14 100644 --- a/DB.py +++ b/DB.py @@ -92,7 +92,8 @@ def build_squadrons_current_data() -> None: def last_known_squadron() -> int: - if (res := db.execute(SQLRequests.last_known_squadron).fetchone()) is None: + res = db.execute(SQLRequests.last_known_squadron).fetchone() + if res is None or res['squad_id'] is None: return 0 else: