summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-03-02 10:05:04 +0100
committerTobrun <tobrun@mapbox.com>2018-03-26 11:38:48 -0400
commit3a1db905fc2258a67385a742393893d982ca896c (patch)
tree34e4f276ef3f91e96d656737557ff11fcd7d0bcd
parent804738fe145c43628648c8dd352d649b57bc7037 (diff)
downloadqtlocation-mapboxgl-3a1db905fc2258a67385a742393893d982ca896c.tar.gz
[android] - validate if width and height aren't 0 when creating options class
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
index 161b4c7380..0895096f6e 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
@@ -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;
}