diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-04 12:21:59 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:23 +0200 |
| commit | f58b61bd39a59599710c5ea7dcf0af52d6e5b679 (patch) | |
| tree | a03cbddb91674a512ddb1a974f4271c56261c691 /go/ui | |
| parent | 1ef796e47bb55b4ec4b105cf59f0c4eafe89a682 (diff) | |
| download | muhqs-game-f58b61bd39a59599710c5ea7dcf0af52d6e5b679.tar.gz muhqs-game-f58b61bd39a59599710c5ea7dcf0af52d6e5b679.zip | |
prevent crash when not all number choice buttons are used
Diffstat (limited to 'go/ui')
| -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 } |
