From f989d518039c2f85239025c6883f4cb87b0e7664 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sat, 24 Aug 2024 06:24:02 -0500 Subject: [PATCH] widgets(term): prevent nil access of vaxis on osc11 The `vx` field can be nil if the terminal widget hasn't been drawn yet. Guard access to this field. Signed-off-by: Tim Culverhouse --- widgets/term/osc.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/widgets/term/osc.go b/widgets/term/osc.go index c101e01..0530783 100644 --- a/widgets/term/osc.go +++ b/widgets/term/osc.go @@ -25,6 +25,9 @@ func (vt *Model) osc(data string) { case "9": vt.postEvent(EventNotify{Body: val}) case "11": + if vt.vx == nil { + return + } go func() { rgb := vt.vx.QueryBackground().Params() if len(rgb) == 0 { -- 2.45.2