Skip to content

Commit

Permalink
fix: empty file is correctly skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
racinmat authored and EwenQuim committed Sep 30, 2024
1 parent c5506d3 commit 1abe9c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parser/filehandling.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package parser

import (
"bufio"
"errors"
"io"
"log"
"os"
Expand Down Expand Up @@ -31,6 +32,9 @@ func GetRenpyContent(rootPath string) []string {
var bom [3]byte
_, err = io.ReadFull(readFile, bom[:])
if err != nil {
if errors.Is(err, io.EOF) { // skip empty file
continue
}
log.Fatal(err)
}
if bom[0] != 0xef || bom[1] != 0xbb || bom[2] != 0xbf {
Expand Down

0 comments on commit 1abe9c6

Please sign in to comment.