CRITICAL: BOT_USER None Reference Causes Crashes #20
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
globals.BOT_USER is accessed without null checks, causing AttributeError when it is None.
Where It Occurs
Why This Is a Problem
What Can Go Wrong
Scenario 1: Early Event Handler
Scenario 2: Mood System Crash
Proposed Fix
Add null checks and initialize with safe default. Create get_bot_user() helper that raises RuntimeError if not initialized.
Severity
CRITICAL - None references cause immediate crashes on startup and during operation.
Files Affected
bot/globals.py, bot/utils/moods.py