Skip to content

Commit

Permalink
fix 0 divided by 0 in part count calculation (#1114)
Browse files Browse the repository at this point in the history
Fixes #1113
  • Loading branch information
balamurugana authored Nov 12, 2020
1 parent d49172e commit 53e9abb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/src/main/java/io/minio/PutObjectArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private long[] partInfo(long objectSize, long partSize) {
}

long partCount = (long) Math.ceil((double) objectSize / partSize);
return new long[] {partSize, partCount};
return new long[] {partSize, partCount == 0 ? 1 : partCount};
}

double pSize = Math.ceil((double) objectSize / MAX_MULTIPART_COUNT);
Expand Down

0 comments on commit 53e9abb

Please sign in to comment.