Fix nil pointer dereference to git ScanOptions (#1603)

This commit is contained in:
Miccah 2023-08-03 12:07:24 -05:00 committed by GitHub
parent d062834997
commit e322c4b29d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -115,6 +115,9 @@ func (s *Source) Init(aCtx context.Context, name string, jobId, sourceId int64,
s.sourceId = sourceId
s.jobId = jobId
s.verify = verify
if s.scanOptions == nil {
s.scanOptions = &ScanOptions{}
}
var conn sourcespb.Git
if err := anypb.UnmarshalTo(connection, &conn, proto.UnmarshalOptions{}); err != nil {