Skip to content

Commit

Permalink
Quick fix for an empty config SEGV on nil rest.Config bug (#500)
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy St. Clair <[email protected]>
  • Loading branch information
timothysc authored Jul 23, 2018
1 parent 3e5e07f commit 2f949b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmd/sonobuoy/app/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ import (
)

func getSonobuoyClient(cfg *rest.Config) (*client.SonobuoyClient, error) {
skc, err := sonodynamic.NewAPIHelperFromRESTConfig(cfg)
if err != nil {
return nil, errors.Wrap(err, "couldn't get sonobuoy api helper")
var skc *sonodynamic.APIHelper
var err error
if cfg != nil {
skc, err = sonodynamic.NewAPIHelperFromRESTConfig(cfg)
if err != nil {
return nil, errors.Wrap(err, "couldn't get sonobuoy api helper")
}
}
return client.NewSonobuoyClient(cfg, skc)
}

0 comments on commit 2f949b5

Please sign in to comment.