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: {}: {} ",