Skip to content

Commit

Permalink
Don't fail if file hash is null (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Sep 15, 2021
1 parent ad27a0d commit fd353ee
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,15 @@ public UploadResult call() {
byte[] md5 = block.getValue().getContentMd5();
long endTime = System.currentTimeMillis();

String fileHash = null;
// seen to occur when uploading large files, (768mb in this case)
// 201 response code with no hash in response
if (md5 != null) {
fileHash = new String(md5, StandardCharsets.UTF_8);
}

return new UploadResult(block.getStatusCode(), null,
new String(md5, StandardCharsets.UTF_8),
fileHash,
uploadObject.getName(),
uploadObject.getUrl(), length, uploadObject.getStorageType(),
startTime, endTime);
Expand Down

0 comments on commit fd353ee

Please sign in to comment.