aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_color.go
diff options
context:
space:
mode:
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)