aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-22 16:16:41 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-07-24 12:22:10 -0400
commita0db7bb48e876fc3262c89a232b2fed1de8cf6e4 (patch)
tree6b7a76a8507b4d174cc1a1b61863d492d0bb9b89
parentee963b2772d6416fae9a11ffe7414b3e7eda7301 (diff)
downloadmuhqs-game-a0db7bb48e876fc3262c89a232b2fed1de8cf6e4.tar.gz
muhqs-game-a0db7bb48e876fc3262c89a232b2fed1de8cf6e4.zip
do not pass nil selections to prompt
-rw-r--r--go/client/keybindings.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/go/client/keybindings.go b/go/client/keybindings.go
index 1dbf6bea..147afced 100644
--- a/go/client/keybindings.go
+++ b/go/client/keybindings.go
@@ -60,6 +60,9 @@ func (g *Game) handleKeyBindings(bindings keyBindings) (err error) {
func selection(ev ui.InputEvent, g *Game) (bool, error) {
x, y := ev.X, ev.Y
obj := g.findObjectAt(x, y)
+ if obj == nil {
+ return false, nil
+ }
if g.prompt != nil {
if err := g.prompt.Add(obj); err != nil {