From 88d71d6bd9ebb3cd686543f1258f93fffba1d4f8 Mon Sep 17 00:00:00 2001 From: UmmulkiramR Date: Wed, 22 Nov 2023 13:02:36 -0500 Subject: [PATCH] fix for issue #385 --- .../server/repository/azure/AzureDownloadService.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/score-server/src/main/java/bio/overture/score/server/repository/azure/AzureDownloadService.java b/score-server/src/main/java/bio/overture/score/server/repository/azure/AzureDownloadService.java index c37fbc32..8ebfbafa 100644 --- a/score-server/src/main/java/bio/overture/score/server/repository/azure/AzureDownloadService.java +++ b/score-server/src/main/java/bio/overture/score/server/repository/azure/AzureDownloadService.java @@ -43,6 +43,7 @@ import java.net.URISyntaxException; import java.util.Base64; import java.util.List; +import java.util.Objects; import static com.google.common.base.Preconditions.checkArgument; @@ -101,7 +102,12 @@ public ObjectSpecification download(String objectId, long offset, long length, b } fillPartUrls(objectId, parts); - val md5 = base64ToHexMD5(blob.getProperties().getContentMD5()); + String contentMd5 = blob.getProperties().getContentMD5(); + String md5 = null; + if(Objects.nonNull(contentMd5)) { + md5 = base64ToHexMD5(contentMd5); + } + return new ObjectSpecification(objectId, objectId, objectId, parts, rangeLength, md5, false); } catch (StorageException e) { log.error("Failed to download objectId: {}, offset: {}, length: {}, forExternalUse: {}: {} ",