config: Fix crash caused by nil map

This commit is contained in:
Adnan Maolood 2021-03-20 23:45:55 -04:00
parent 26983cf57a
commit 2da77c0b80

View file

@ -38,6 +38,9 @@ func (t Task) Format(p *Page) (string, []byte) {
// LoadConfig loads the configuration from the provided path.
func LoadConfig(path string) (*Config, error) {
c := new(Config)
c.Feeds = make(map[string]string)
c.Tasks = make(map[string]*Task)
f, err := os.Open(path)
if err != nil {
return nil, err