From c409bc1a1e5748930728a190cebc1c6058ecf803 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 7 May 2024 20:14:46 -0400 Subject: [PATCH] Don't crash when user hovers over nothing --- event.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/event.go b/event.go index ad55ecf..fd3fbd2 100644 --- a/event.go +++ b/event.go @@ -339,11 +339,13 @@ func (window *window) handleMotionNotify ( } underneath := window.boxUnder(image.Pt(x, y), eventCategoryMouse) - window.hover(underneath) - - if !handled { - underneath.handleMouseMove() + if underneath != nil { + window.hover(underneath) + if !handled { + underneath.handleMouseMove() + } } + } func (window *window) compressExpose (