From 4e363876e768bc6d701e6a13cda0173a246890c3 Mon Sep 17 00:00:00 2001 From: Lili Date: Sun, 6 Oct 2024 15:23:48 +0200 Subject: [PATCH] add None points handling to redeems_handler --- tlapbot/redeems_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tlapbot/redeems_handler.py b/tlapbot/redeems_handler.py index e0d4d32..9b5c0a0 100644 --- a/tlapbot/redeems_handler.py +++ b/tlapbot/redeems_handler.py @@ -25,6 +25,11 @@ def handle_redeem(message: str, user_id: str) -> None: redeem_type = current_app.config['REDEEMS'][redeem]["type"] points = read_users_points(db, user_id) + if points is None: + send_chat(f"Can't redeem {redeem}, failed to read users' points.") + return + + # handle milestone first because it doesn't have a price if redeem_type == "milestone": if milestone_complete(db, redeem):