summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2018-03-02 10:05:04 +0100
committerTobrun <tobrun.van.nuland@gmail.com>2018-03-02 10:05:04 +0100
commit3bbc2baa1e30e60ffada8e686b7d2ab218fb3101 (patch)
treea1306e99e8f1b2d13912e24dadcb905550f62023
parent87f88f37c4d111cc0f329f0e5f9c3fb10aae69bb (diff)
downloadqtlocation-mapboxgl-upstream/tvn-check-snapshot-widht-height-0.tar.gz
[android] - validate if width and height aren't 0 when creating options classupstream/tvn-check-snapshot-widht-height-0
-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 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;
}