Skip to content

Commit 879e65b

Browse files
Handle nil file channel (#417)
1 parent 09de492 commit 879e65b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/sources/git/git.go

+4
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,10 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOp
272272
if err != nil {
273273
return errors.WrapPrefix(err, "could not open repo path", 0)
274274
}
275+
// parser can return nil chan and nil error
276+
if fileChan == nil {
277+
return errors.New("nothing to scan")
278+
}
275279

276280
// get the URL metadata for reporting (may be empty)
277281
urlMetadata := getSafeRemoteURL(repo, "origin")

0 commit comments

Comments
 (0)