Skip to content

Commit dac2e64

Browse files
authored
Merge pull request #7 from AppCoreNet/fixes/fix-issue-5
Fixed 'NullReferenceException' when no hash algorithm is specified for 'export-key' command.
2 parents 0a21fdb + e8fe5da commit dac2e64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/AppCore.SigningTool/Commands/Sn/SnExportPublicKeyCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ public void Configure(CommandLineApplication cmd)
3939
.OnValidate(
4040
vc =>
4141
{
42-
if (ParseAssemblyHashAlgorithm(_hashAlgorithm.ParsedValue) == AssemblyHashAlgorithm.None)
42+
if (_hashAlgorithm.HasValue()
43+
&& ParseAssemblyHashAlgorithm(_hashAlgorithm.ParsedValue) == AssemblyHashAlgorithm.None)
44+
{
4345
return new ValidationResult($"Unknown hash algorithm '{_hashAlgorithm.ParsedValue}'.");
46+
}
4447

4548
return ValidationResult.Success;
4649
});

0 commit comments

Comments
 (0)