Fix possible NPE
This commit is contained in:
parent
34ea004ea2
commit
35c53ed5e3
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue