mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
Fix SEGV due to empty config
This commit is contained in:
parent
f8315deb9c
commit
f47b6e7657
1 changed files with 3 additions and 3 deletions
|
|
@ -9,8 +9,8 @@ import (
|
|||
|
||||
// Config defines Icinga DB config.
|
||||
type Config struct {
|
||||
Database *Database `yaml:"database"`
|
||||
Redis *Redis `yaml:"redis"`
|
||||
Database Database `yaml:"database"`
|
||||
Redis Redis `yaml:"redis"`
|
||||
}
|
||||
|
||||
// Flags defines CLI flags.
|
||||
|
|
@ -32,7 +32,7 @@ func FromYAMLFile(name string) (*Config, error) {
|
|||
c := &Config{}
|
||||
d := yaml.NewDecoder(f)
|
||||
|
||||
if err := d.Decode(&c); err != nil {
|
||||
if err := d.Decode(c); err != nil {
|
||||
return nil, errors.Wrap(err, "can't parse YAML file "+name)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue