[android] - validate if width and height aren't 0 when creating options class

This commit is contained in:
Tobrun
2018-03-02 10:05:04 +01:00
committed by Tobrun
parent 804738fe14
commit 3a1db905fc

View File

@@ -95,6 +95,9 @@ public class MapSnapshotter {
* @param height the height of the image
*/
public Options(int width, int height) {
if (width == 0 || height == 0) {
throw new IllegalArgumentException("Unable to create a snapshot with width or height set to 0");
}
this.width = width;
this.height = height;
}