From af904467582e79d8dbf2a405776a81131ff1fa11 Mon Sep 17 00:00:00 2001 From: Tobrun Date: Mon, 23 Oct 2017 06:21:26 +0200 Subject: [PATCH] [android] - null check mapboxMap with onStop invocation --- .../src/main/java/com/mapbox/mapboxsdk/maps/MapView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index 309090ed3f6..f4198cdde7f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -369,7 +369,10 @@ public void onPause() { */ @UiThread public void onStop() { - mapboxMap.onStop(); + if (mapboxMap != null) { + // map was destroyed before it was started + mapboxMap.onStop(); + } ConnectivityReceiver.instance(getContext()).deactivate(); FileSource.getInstance(getContext()).deactivate(); }