mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-16 01:02:06 +01:00
Require bytes greater 0
This commit is contained in:
parent
df41a4dc9a
commit
ddbbc63aae
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue