diff options
| author | Jeff Carr <[email protected]> | 2025-02-13 22:24:34 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-13 22:24:34 -0600 |
| commit | 5a9f3565aaf596cf3ed399241df897dbe07042eb (patch) | |
| tree | 28e6848bf28546a661e03f17b6df6aac357fd0ee /stdoutShow.go | |
| parent | 1f33979af9d295ab7957dca55db9be5ba19c6324 (diff) | |
protect against another nil
Diffstat (limited to 'stdoutShow.go')
| -rw-r--r-- | stdoutShow.go | 5 |
1 files changed, 5 insertions, 0 deletions
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() |
