Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit c0072ce

Browse files
authored
Fix null reference exception (#437)
1 parent 3c1928f commit c0072ce

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Validation.PackageSigning.ProcessSignature/SignatureFormatValidator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ public SignatureFormatValidator(IOptionsSnapshot<ProcessSignatureConfiguration>
6464

6565
var repoAllowListEntries = _config
6666
.Value
67-
.AllowedRepositorySigningCertificates
67+
.AllowedRepositorySigningCertificates?
6868
.Select(hash => new CertificateHashAllowListEntry(
6969
VerificationTarget.Repository,
7070
SignaturePlacement.PrimarySignature | SignaturePlacement.Countersignature,
7171
hash,
7272
HashAlgorithmName.SHA256))
7373
.ToList();
7474

75+
repoAllowListEntries = repoAllowListEntries ?? new List<CertificateHashAllowListEntry>();
76+
7577
_authorOrRepositorySignatureSettings = new SignedPackageVerifierSettings(
7678
allowUnsigned: _authorSignatureSettings.AllowUnsigned,
7779
allowIllegal: _authorSignatureSettings.AllowIllegal,

0 commit comments

Comments
 (0)