Merge pull request #1047 from docker/fix-stdin-nil

Check if stdin is nil before closing
This commit is contained in:
Djordje Lukic 2020-12-11 10:20:26 +01:00 committed by GitHub
commit 817ecaabaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -80,7 +80,9 @@ func (s *composeService) attachContainerStreams(ctx context.Context, container m
go func() {
<-ctx.Done()
stdout.Close() //nolint:errcheck
stdin.Close() //nolint:errcheck
if stdin != nil {
stdin.Close() //nolint:errcheck
}
}()
if r != nil && stdin != nil {