Skip to content

Commit

Permalink
Merge pull request #2558 from tiborvass/19.03-expenv-panic
Browse files Browse the repository at this point in the history
[19.03] Fix bug with panic when DOCKER_CLI_EXPERIMENTAL environment variable is incorrect
  • Loading branch information
cpuguy83 authored May 28, 2020
2 parents 92b54c2 + e90b6bc commit dd360c7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/command/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ func (cli *DockerCli) ServerInfo() ServerInfo {
// ClientInfo returns the client details for the cli
func (cli *DockerCli) ClientInfo() ClientInfo {
if cli.clientInfo == nil {
_ = cli.loadClientInfo()
if err := cli.loadClientInfo(); err != nil {
panic(err)
}
}
return *cli.clientInfo
}
Expand Down Expand Up @@ -277,6 +279,11 @@ func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...Initialize
}
}
cli.initializeFromClient()

if err := cli.loadClientInfo(); err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit dd360c7

Please sign in to comment.