diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-04 12:21:59 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-07-06 11:49:19 -0400 |
| commit | 7569b59c949b690a4fa3d7e6494863331cc723d6 (patch) | |
| tree | 223430d15581b6be26635834f3ec32349f627bc8 | |
| parent | 0365c1b0bb99dd5dfdf301c00fb44a25dc7bbd88 (diff) | |
| download | muhqs-game-7569b59c949b690a4fa3d7e6494863331cc723d6.tar.gz muhqs-game-7569b59c949b690a4fa3d7e6494863331cc723d6.zip | |
prevent crash when not all number choice buttons are used
| -rw-r--r-- | go/ui/choice.go | 2 |
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 } |
