Skip to content

Commit 5782bbf

Browse files
chaitanya-bhagavanMasu Lin
authored andcommitted
Fixes google map null pointer exception (react-native-maps#1403)
AirMapView doDestroy is called before LifecycleEventListener onHostPause. This fixes react-native-maps#1358
1 parent 9036526 commit 5782bbf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ public void onHostPause() {
314314
map.setMyLocationEnabled(false);
315315
}
316316
synchronized (AirMapView.this) {
317-
AirMapView.this.onPause();
317+
if(!destroyed) {
318+
AirMapView.this.onPause();
319+
}
318320
paused = true;
319321
}
320322
}

0 commit comments

Comments
 (0)