Skip to content

Commit

Permalink
Require bytes greater 0
Browse files Browse the repository at this point in the history
  • Loading branch information
vanitasvitae committed Aug 31, 2019
1 parent 02f59df commit 9f2a5c8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public class MetadataInfo {
public MetadataInfo(String id, URL url, long bytes, String type, int pixelsHeight, int pixelsWidth) {
this.id = StringUtils.requireNotNullNorEmpty(id, "ID is required.");
this.url = url;
if (bytes <= 0) {
throw new IllegalArgumentException("Number of bytes MUST be greater than 0.");
}
this.bytes = UInt32.from(bytes);
this.type = StringUtils.requireNotNullNorEmpty(type, "Content Type is required.");
if (pixelsHeight < 0 || pixelsHeight > MAX_HEIGHT) {
Expand Down

0 comments on commit 9f2a5c8

Please sign in to comment.