aboutsummaryrefslogtreecommitdiff
path: root/go
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-04 12:21:59 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-07-06 11:49:19 -0400
commit7569b59c949b690a4fa3d7e6494863331cc723d6 (patch)
tree223430d15581b6be26635834f3ec32349f627bc8 /go
parent0365c1b0bb99dd5dfdf301c00fb44a25dc7bbd88 (diff)
downloadmuhqs-game-7569b59c949b690a4fa3d7e6494863331cc723d6.tar.gz
muhqs-game-7569b59c949b690a4fa3d7e6494863331cc723d6.zip
prevent crash when not all number choice buttons are used
Diffstat (limited to 'go')
-rw-r--r--go/ui/choice.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/go/ui/choice.go b/go/ui/choice.go
index 9de5fd45..cdd01155 100644
--- a/go/ui/choice.go
+++ b/go/ui/choice.go
@@ -105,7 +105,7 @@ func NewNumberChoice(x, y int, startValue int, onSubmit func(*NumberChoice)) *Nu
}
nc.EventHandlersMap["click"] = func(x, y int) {
for _, b := range nc.buttons {
- if b.Contains(x, y) {
+ if b != nil && b.Contains(x, y) {
b.Click(x, y)
return
}