Skip to content

Commit 1b36396

Browse files
committed
fix(android): ensure map exists on destroy
1 parent 22ffdc8 commit 1b36396

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mapbox.android.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,9 @@ export class MapboxView extends MapboxViewBase {
387387
Application.android.off(AndroidApplication.activityPausedEvent, this.onPause, this);
388388
Application.android.off(AndroidApplication.activityResumedEvent, this.onResume, this);
389389
// Application.android.off(AndroidApplication.activityStartedEvent, this.onStop, this);
390-
391-
this.mapbox.destroy();
390+
if (this.mapbox) {
391+
this.mapbox.destroy();
392+
}
392393
super.disposeNativeView();
393394
}
394395

0 commit comments

Comments
 (0)