Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 817ecaa

Browse files
authored
Merge pull request #1047 from docker/fix-stdin-nil
Check if stdin is nil before closing
2 parents 4f883ca + 72cec58 commit 817ecaa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

local/compose/attach.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ func (s *composeService) attachContainerStreams(ctx context.Context, container m
8080
go func() {
8181
<-ctx.Done()
8282
stdout.Close() //nolint:errcheck
83-
stdin.Close() //nolint:errcheck
83+
if stdin != nil {
84+
stdin.Close() //nolint:errcheck
85+
}
8486
}()
8587

8688
if r != nil && stdin != nil {

0 commit comments

Comments
 (0)