Skip to content

Commit

Permalink
check if config is nil (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperspencer authored Oct 18, 2022
1 parent 5dbb12f commit 527e740
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"os/user"
"path/filepath"
"reflect"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -76,8 +77,11 @@ func readConfigFile(configfile string) []*types.Conf {
Msg("Cannot map yml config file to interface, possible syntax error")
}
}
conf = append(conf, c)
i++

if !reflect.ValueOf(c).IsZero() {
conf = append(conf, c)
i++
}
}

return conf
Expand Down

0 comments on commit 527e740

Please sign in to comment.