diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2018-03-02 10:05:04 +0100 |
---|---|---|
committer | Tobrun <tobrun@mapbox.com> | 2018-03-02 13:44:16 +0100 |
commit | 6ca4949d0f122790f9d82c8c624e7ff7d6f28e5b (patch) | |
tree | d2c80fba06026d3083dfee3eb49375bb1b21fc66 | |
parent | 7d8aaa1bf83b2504ab2368235d508a36e1688067 (diff) | |
download | qtlocation-mapboxgl-6ca4949d0f122790f9d82c8c624e7ff7d6f28e5b.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.java | 3 |
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 1c59bb468e..be5292ab5e 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; } |