From 7429b7531fa1514ec37a8727b6bfb2f9ee49891a Mon Sep 17 00:00:00 2001 From: Tobias Zwick Date: Tue, 19 Jul 2022 15:22:17 +0200 Subject: [PATCH] do not throw NPE onLowMemory when mapController is not set yet --- .../tangram/src/main/java/com/mapzen/tangram/MapView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platforms/android/tangram/src/main/java/com/mapzen/tangram/MapView.java b/platforms/android/tangram/src/main/java/com/mapzen/tangram/MapView.java index 529a0b0a77..f5f497e71d 100644 --- a/platforms/android/tangram/src/main/java/com/mapzen/tangram/MapView.java +++ b/platforms/android/tangram/src/main/java/com/mapzen/tangram/MapView.java @@ -316,7 +316,9 @@ public void onDestroy() { * You must call this method from the parent Activity/Fragment's corresponding method. */ public void onLowMemory() { - mapController.onLowMemory(); + if (mapController != null) { + mapController.onLowMemory(); + } } }