1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-06-23 20:14:51 +02:00

Require bytes greater 0

This commit is contained in:
Paul Schaub 2019-08-31 17:10:51 +02:00
parent 7e4791c4f6
commit c3bec911ba

View file

@ -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) {