Initialize scan options if given a nil pointer (#924)

This commit is contained in:
Miccah 2022-11-15 17:01:59 -06:00 committed by GitHub
parent 696f5c68f4
commit 86f9e1288f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -540,6 +540,9 @@ func (s *Git) ScanUnstaged(ctx context.Context, repo *git.Repository, path strin
}
func (s *Git) ScanRepo(ctx context.Context, repo *git.Repository, repoPath string, scanOptions *ScanOptions, chunksChan chan *sources.Chunk) error {
if scanOptions == nil {
scanOptions = NewScanOptions()
}
if err := normalizeConfig(scanOptions, repo); err != nil {
return err
}