Skip to content

Commit bd2e41a

Browse files
committed
fix(extractor): ignore lines that generate unmarshaling errors
1 parent 5fd44f9 commit bd2e41a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extractor.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,11 @@ func (fe *FastExtractor) Run(path string, after string) chan *GitFile {
7979

8080
err := json.Unmarshal(cleanedLine, &gitFile)
8181
if err != nil {
82+
// If an error occurs, print a warning and do nothing with the line
8283
log.Warnln("Error while parsing", string(line), err)
84+
} else {
85+
fe.ChanGitFiles <- &gitFile
8386
}
84-
85-
fe.ChanGitFiles <- &gitFile
8687
}
8788

8889
log.Infof("finished iterating over files, we have collected %d files\n", num)

0 commit comments

Comments
 (0)