Skip to content

Commit 09de492

Browse files
authored
Check that required info is present (#415)
1 parent 1f55171 commit 09de492

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

pkg/sources/git/git.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ func (s *Git) ScanCommits(repo *git.Repository, path string, scanOptions *ScanOp
279279
var depth int64
280280
var reachedBase = false
281281
for file := range fileChan {
282+
if file == nil || file.PatchHeader == nil {
283+
log.Debugf("file missing patch header, skipping")
284+
continue
285+
}
282286
log.WithField("commit", file.PatchHeader.SHA).WithField("file", file.NewName).Trace("Scanning file from git")
283287
if scanOptions.MaxDepth > 0 && depth >= scanOptions.MaxDepth {
284288
log.Debugf("reached max depth")

0 commit comments

Comments
 (0)