config: Fix crash caused by nil map

This commit is contained in:
adnano 2021-03-20 23:45:55 -04:00
parent 72e9ba2d78
commit d30faf0fcd

View file

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