Skip to content

Commit

Permalink
config: skip empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
doronbehar committed Jul 13, 2020
1 parent d4d8654 commit e8b8ce6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions previewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func NewPreviewer(filePath, configPath string) (Previewer, error) {
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
def := strings.Fields(scanner.Text())
if len(def) == 0 {
// Empty lines are skipped
continue
}
match, err := regexp.MatchString(def[0], p.mimeType)
if err != nil {
return p, err
Expand Down

0 comments on commit e8b8ce6

Please sign in to comment.