Fix possible NPE

This commit is contained in:
Alex Sytnyk 2018-05-30 11:51:07 +03:00
parent 34ea004ea2
commit 35c53ed5e3

View file

@ -67,7 +67,10 @@ public class SelectMapStyleBottomSheetDialogFragment extends MenuBottomSheetDial
stylesMap = generateStylesMap(context);
if (savedInstanceState == null) {
selectedStyle = getMyApplication().getRendererRegistry().getCurrentSelectedRenderer().getName();
RenderingRulesStorage current = getMyApplication().getRendererRegistry().getCurrentSelectedRenderer();
if (current != null) {
selectedStyle = current.getName();
}
} else {
selectedStyle = savedInstanceState.getString(SELECTED_STYLE_KEY);
}