Skip to content

Commit

Permalink
Merge pull request #124 from Comcast/fix-nil-section-bug
Browse files Browse the repository at this point in the history
Fix the missing section crash.
  • Loading branch information
njharter authored Feb 23, 2019
2 parents 1334f64 + e508f6a commit 746211f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/caduceus/caduceus.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ func caduceus(arguments []string) int {
//
// Now, initialize the service discovery infrastructure
//
e, err := servicecfg.NewEnvironment(logger, v.Sub("service"))
if err != nil {
logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Unable to initialize service discovery environment", logging.ErrorKey(), err)
return 4
}
if v.IsSet("service") {
e, err := servicecfg.NewEnvironment(logger, v.Sub("service"))
if err != nil {
logger.Log(level.Key(), level.ErrorValue(), logging.MessageKey(), "Unable to initialize service discovery environment", logging.ErrorKey(), err)
return 4
}

if e != nil {
defer e.Close()
logger.Log(level.Key(), level.InfoValue(), "configurationFile", v.ConfigFileUsed())
e.Register()
Expand Down

0 comments on commit 746211f

Please sign in to comment.