[Mobile] fix NPE

This commit is contained in:
Anthony Calosa
2022-01-18 07:17:23 +08:00
parent 03815d38ea
commit 0097b66cd6
2 changed files with 3 additions and 1 deletions

View File

@@ -93,6 +93,8 @@ public class NewGameMenu extends FPopupMenu {
}
public static NewGameScreen getPreferredScreen() {
if (preferredScreen == null) //shouldn't happen but we return constructed as default
return NewGameScreen.Constructed;
return preferredScreen;
}
public static void setPreferredScreen(NewGameScreen preferredScreen0) {

View File

@@ -67,7 +67,7 @@ public class OnlineMenu extends FPopupMenu {
private void initializeScreen() {
if (screen == null) { //don't initialize screen until it's opened the first time
try {
screen = screenClass.newInstance();
screen = screenClass.getConstructor().newInstance();
screen.setHeaderCaption(Localizer.getInstance().getMessage("lblPlayOnline") + " - " + item.getText());
}
catch (Exception e) {