[android] - avoid null pointer if map wasn't initalised when saving instance state

This commit is contained in:
Tobrun
2017-10-30 11:22:47 -07:00
committed by Tobrun
parent 5893af7f24
commit b8d5798bea

View File

@@ -329,8 +329,10 @@ public class MapView extends FrameLayout {
*/
@UiThread
public void onSaveInstanceState(@NonNull Bundle outState) {
outState.putBoolean(MapboxConstants.STATE_HAS_SAVED_STATE, true);
mapboxMap.onSaveInstanceState(outState);
if (mapboxMap != null) {
outState.putBoolean(MapboxConstants.STATE_HAS_SAVED_STATE, true);
mapboxMap.onSaveInstanceState(outState);
}
}
/**