altosdroid: Skip map draw before transform is set
authorKeith Packard <keithp@keithp.com>
Mon, 11 Oct 2021 06:01:18 +0000 (23:01 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 11 Oct 2021 06:01:18 +0000 (23:01 -0700)
A crash report indicates that this can happen.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/app/src/main/java/org/altusmetrum/AltosDroid/AltosMapOffline.java

index 60c209e105cf22fee5cb891be1d008c5cff87657..7bd57a4ca39ebfcd19e44a130c91ef20c15db2a8 100644 (file)
@@ -360,6 +360,10 @@ public class AltosMapOffline extends View implements ScaleGestureDetector.OnScal
                        debug("MapView draw without map\n");
                        return;
                }
+               if (map.transform == null) {
+                       debug("MapView draw without transform\n");
+                       return;
+               }
                canvas = view_canvas;
                paint = new Paint(Paint.ANTI_ALIAS_FLAG);
                paint.setStrokeWidth(stroke_width);