Skip to content

Commit

Permalink
Change NativeMapView to use 0 instead of throwing IllegalArgumentExce…
Browse files Browse the repository at this point in the history
…ption when resizeView is called with a negative width or height (#151)
  • Loading branch information
thirstycoda authored Sep 6, 2021
1 parent 206bca7 commit f09e9ab
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,17 @@ public void resizeView(int width, int height) {
height = (int) Math.ceil(height / pixelRatio);

if (width < 0) {
throw new IllegalArgumentException("width cannot be negative.");
Logger.e(TAG, String.format("Device returned a negative width size, "
+ "setting value to 0 instead of %s", width)
);
width = 0;
}

if (height < 0) {
throw new IllegalArgumentException("height cannot be negative.");
Logger.e(TAG, String.format("Device returned a negative height size, "
+ "setting value to 0 instead of %s", height)
);
height = 0;
}

if (width > 65535) {
Expand Down

0 comments on commit f09e9ab

Please sign in to comment.