Skip to content

Commit 7d52837

Browse files
mufenqwqadababys
andcommitted
fix(envd): guard nil tty in Handler.Wait for non-PTY processes
Co-authored-by: AdaAibaby <shaolila@buaa.edu.cn>
1 parent 02064f2 commit 7d52837

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/envd/internal/services/process/handler

‎packages/envd/internal/services/process/handler/handler.go‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,10 @@ func (p *Handler) Wait() {
572572

573573
err := p.cmd.Wait()
574574

575-
p.tty.Close()
575+
// Processes started without a PTY have no tty to close.
576+
if p.tty != nil {
577+
p.tty.Close()
578+
}
576579

577580
var errMsg *string
578581

0 commit comments

Comments
 (0)