Skip to content

Commit

Permalink
added null check in logging for discovery.
Browse files Browse the repository at this point in the history
  • Loading branch information
joevanwanzeeleKF committed Jan 23, 2024
1 parent 0ecb4d9 commit ba74492
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hashicorp-vault-orchestrator/Jobs/Discovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public JobResult ProcessJob(DiscoveryJobConfiguration config, SubmitDiscoveryUpd
}
// if no vaults were discovered, but there are warnings, the job status is "failure".

if (vaults.Count() == 0 && warnings.Count() > 0) {
if (vaults.Count() == 0 && warnings?.Count() > 0) {
failureMessage = $"{warnings.Count()} errors during discovery job:\n{string.Join("\n", warnings)}";
}

Expand Down

0 comments on commit ba74492

Please sign in to comment.