aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_color.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-09-18 05:31:09 -0400
committerhistoria <[not public]>2026-09-18 05:31:09 -0400
commit153acb7f644d755c45533b7c5311e3ffa47e8973 (patch)
tree7645e6f7b65bc3830b078e3b9336d2e6b199d584 /internal/game/cmd_color.go
parent87d08f0151e643951769e323995f1c5ed89ee200 (diff)
downloadthehouseoficarus-153acb7f644d755c45533b7c5311e3ffa47e8973.tar.gz
fix: harden engine across casino, economy, concurrency, security, and content
Diffstat (limited to 'internal/game/cmd_color.go')
-rw-r--r--internal/game/cmd_color.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/game/cmd_color.go b/internal/game/cmd_color.go
index 614583f..104d359 100644
--- a/internal/game/cmd_color.go
+++ b/internal/game/cmd_color.go
@@ -67,6 +67,12 @@ func (g *Game) doColor(sess *net.Session, input string) {
}
func (g *Game) saveAccountColor(sess *net.Session, target, value string) {
+ // The account can be gone (purged or republished from another session)
+ // while the player is still live; there is nothing to persist to then.
+ if sess.Account == nil {
+ sess.WriteLine("You must be logged into an account to set colors.")
+ return
+ }
if value == "" {
if sess.Account.Colors != nil {
delete(sess.Account.Colors, target)