Skip to content

Commit

Permalink
Merge pull request #7502 from dolthub/db/fix-panic
Browse files Browse the repository at this point in the history
[no-release-notes] /go/libraries/doltcore/env/config.go: fix no config panic
  • Loading branch information
coffeegoddd authored Feb 15, 2024
2 parents df2072e + d74a1db commit 6464c3e
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 6464c3e

Please sign in to comment.