mirror of
https://github.com/docker/compose.git
synced 2025-07-21 20:54:32 +02:00
Check if stdin is nil before closing
getContainerStreams returns a nil stdin if the container is already running Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
This commit is contained in:
parent
4f883cae26
commit
72cec58ed1
@ -80,7 +80,9 @@ func (s *composeService) attachContainerStreams(ctx context.Context, container m
|
|||||||
go func() {
|
go func() {
|
||||||
<-ctx.Done()
|
<-ctx.Done()
|
||||||
stdout.Close() //nolint:errcheck
|
stdout.Close() //nolint:errcheck
|
||||||
stdin.Close() //nolint:errcheck
|
if stdin != nil {
|
||||||
|
stdin.Close() //nolint:errcheck
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if r != nil && stdin != nil {
|
if r != nil && stdin != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user