From 5a9f3565aaf596cf3ed399241df897dbe07042eb Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 13 Feb 2025 22:24:34 -0600 Subject: [PATCH] protect against another nil --- stdoutShow.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdoutShow.go b/stdoutShow.go index 38fc837..75a4ae5 100644 --- a/stdoutShow.go +++ b/stdoutShow.go @@ -166,6 +166,11 @@ func (w stdout) Write(p []byte) (n int, err error) { } func (w *guiWidget) Write(p []byte) (n int, err error) { + if w == nil { + lines := strings.Split(strings.TrimSpace(string(p)), "\n") + me.stdout.outputS = append(me.stdout.outputS, lines...) + return len(p), nil + } w.tainted = true me.writeMutex.Lock() defer me.writeMutex.Unlock()