Skip to content

Commit 2eb914a

Browse files
authored
Merge pull request #303 from Icinga/bugfix/cfg-segv
Fix SEGV due to empty config
2 parents 7bf7501 + f47b6e7 commit 2eb914a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/config/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99

1010
// Config defines Icinga DB config.
1111
type Config struct {
12-
Database *Database `yaml:"database"`
13-
Redis *Redis `yaml:"redis"`
12+
Database Database `yaml:"database"`
13+
Redis Redis `yaml:"redis"`
1414
}
1515

1616
// Flags defines CLI flags.
@@ -32,7 +32,7 @@ func FromYAMLFile(name string) (*Config, error) {
3232
c := &Config{}
3333
d := yaml.NewDecoder(f)
3434

35-
if err := d.Decode(&c); err != nil {
35+
if err := d.Decode(c); err != nil {
3636
return nil, errors.Wrap(err, "can't parse YAML file "+name)
3737
}
3838

0 commit comments

Comments
 (0)