Skip to content

Commit

Permalink
prevent crash when .dockercfg not readable
Browse files Browse the repository at this point in the history
  • Loading branch information
vieux committed Aug 14, 2013
1 parent 4cb57a5 commit 3c9f994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func LoadConfig(rootPath string) (*ConfigFile, error) {
}
b, err := ioutil.ReadFile(confFile)
if err != nil {
return nil, err
return &configFile, err
}

if err := json.Unmarshal(b, &configFile.Configs); err != nil {
Expand Down
5 changes: 4 additions & 1 deletion commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,10 @@ func NewDockerCli(in io.ReadCloser, out, err io.Writer, proto, addr string) *Doc
err = out
}

configFile, _ := auth.LoadConfig(os.Getenv("HOME"))
configFile, e := auth.LoadConfig(os.Getenv("HOME"))
if e != nil {
fmt.Fprintf(err, "WARNING: %s\n", e)
}
return &DockerCli{
proto: proto,
addr: addr,
Expand Down

0 comments on commit 3c9f994

Please sign in to comment.