wormhole/commands/moderation.py: 9 commands missing null check on _net() result #8
Labels
No labels
bug
compliance
documentation
duplicate
enhancement
gdpr
good first issue
help wanted
invalid
performance
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: SheWhoReignsSupreme/EveCogs#8
Loading…
Add table
Reference in a new issue
No description provided.
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?
Summary
The recent commit 1fbb265 added null checks for network existence to settings.py — but the same fix was not applied to moderation.py. Nine moderation commands call
_net(name)and immediately use the result without checking if it'sNone, causing an unhandled crash (AttributeError/TypeError) when an invalid network name is given.Affected commands
wh_mod_unbanwh_mod_mutewh_mod_unmutewh_mod_banserverwh_mod_unbanserverwh_mod_muteserverwh_mod_unmuteserverwh_mod_allowserverwh_mod_removeallowExample (L44 —
wh_mod_unban)Fix
Add an early-return guard after every
_net()call, identical to how settings.py handles it:This is the same pattern already used in
wh_mod_ban(L25),wh_mod_purge(L173), and all of settings.py.