Skip to content

Commit

Permalink
fix: panic when setting defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanSpeakEasy committed Mar 5, 2023
1 parent 19efff8 commit 6474131
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions io.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ func Load(dir string, opts ...Option) (*Config, error) {
}

for k, v := range langCfg.Cfg {
if cfg.Languages[lang].Cfg == nil {
langCfg = cfg.Languages[lang]
langCfg.Cfg = map[string]interface{}{}
cfg.Languages[lang] = langCfg
}

if _, ok := cfg.Languages[lang].Cfg[k]; !ok {
cfg.Languages[lang].Cfg[k] = v
}
Expand Down

0 comments on commit 6474131

Please sign in to comment.