Skip to content

Commit

Permalink
/go/libraries/doltcore/env/config.go: fix no config panic
Browse files Browse the repository at this point in the history
  • Loading branch information
coffeegoddd committed Feb 15, 2024
1 parent 1c2b8d8 commit d74a1db
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/libraries/doltcore/env/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ func (dcc *DoltCliConfig) IfEmptyUseConfig(val, key string) string {
}

func GetStringOrDefault(cfg config.ReadableConfig, key, defStr string) string {
if cfg == nil {
return defStr
}
val, err := cfg.GetString(key)

if err != nil {
return defStr
}

return val
}

Expand Down

0 comments on commit d74a1db

Please sign in to comment.