Skip to content

Commit

Permalink
Add null check for hexDigests in 'storeHardLink' method for 'FileHash…
Browse files Browse the repository at this point in the history
…StoreLinks' to be safe
  • Loading branch information
doulikecookiedough committed Nov 13, 2024
1 parent 1aedf44 commit ba90aa4
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public ObjectMetadata storeHardLink(

try (InputStream fileStream = Files.newInputStream(filePath)) {
Map<String, String> hexDigests = generateChecksums(fileStream, checksumAlgorithm);
FileHashStoreUtility.ensureNotNull(hexDigests, "hexDigests");
String checksumToMatch = hexDigests.get(checksumAlgorithm);
if (!checksum.equalsIgnoreCase(checksumToMatch)) {
String errMsg = "Checksum supplied: " + checksum + " does not match what has been"
Expand Down

0 comments on commit ba90aa4

Please sign in to comment.