[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 7d8aaa1bf8
commit 6ca4949d0f

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;
}