add None points handling to redeems_handler

This commit is contained in:
Lili (Tlapka) 2024-10-06 15:23:48 +02:00
parent 20e3d6d4b2
commit 4e363876e7

View File

@ -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):