Reject non-positive camera sizes early
Throw an exception on parsing if the camera size dimensions are not both positive.
This commit is contained in:
parent
09741bc805
commit
c15df01171
@ -475,6 +475,9 @@ public class Options {
|
||||
}
|
||||
int width = Integer.parseInt(tokens[0]);
|
||||
int height = Integer.parseInt(tokens[1]);
|
||||
if (width <= 0 || height <= 0) {
|
||||
throw new IllegalArgumentException("Invalid non-positive size dimension: \"" + size + "\"");
|
||||
}
|
||||
return new Size(width, height);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user