From e322c4b29d568832f80cbbe933ec8c211420bd93 Mon Sep 17 00:00:00 2001 From: Miccah Date: Thu, 3 Aug 2023 12:07:24 -0500 Subject: [PATCH] Fix nil pointer dereference to git ScanOptions (#1603) --- pkg/sources/git/git.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go index 5148c7bb67e9..f224ef5f72bd 100644 --- a/pkg/sources/git/git.go +++ b/pkg/sources/git/git.go @@ -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 {