diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java index 8f3f487c7..d457f428a 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/LauncherActivity.java @@ -106,13 +106,12 @@ public class LauncherActivity extends BaseActivity { } String selectedProfile = LauncherPreferences.DEFAULT_PREF.getString(LauncherPreferences.PREF_KEY_CURRENT_PROFILE,""); - if (LauncherProfiles.mainProfileJson == null || LauncherProfiles.mainProfileJson.profiles == null - || !LauncherProfiles.mainProfileJson.profiles.containsKey(selectedProfile)){ + if (LauncherProfiles.mainProfileJson == null || !LauncherProfiles.mainProfileJson.profiles.containsKey(selectedProfile)){ Toast.makeText(this, R.string.error_no_version, Toast.LENGTH_LONG).show(); return false; } MinecraftProfile prof = LauncherProfiles.mainProfileJson.profiles.get(selectedProfile); - if (prof == null || prof.lastVersionId == null){ + if (prof == null || prof.lastVersionId == null || "Unknown".equals(prof.lastVersionId)){ Toast.makeText(this, R.string.error_no_version, Toast.LENGTH_LONG).show(); return false; } diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/value/launcherprofiles/LauncherProfiles.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/value/launcherprofiles/LauncherProfiles.java index a231f0126..0efd39842 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/value/launcherprofiles/LauncherProfiles.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/value/launcherprofiles/LauncherProfiles.java @@ -12,6 +12,7 @@ public class LauncherProfiles { if (mainProfileJson == null) { if (launcherProfilesFile.exists()) { mainProfileJson = Tools.GLOBAL_GSON.fromJson(Tools.read(launcherProfilesFile.getAbsolutePath()), MinecraftLauncherProfiles.class); + if(mainProfileJson.profiles == null) mainProfileJson.profiles = new HashMap<>(); } else { mainProfileJson = new MinecraftLauncherProfiles(); mainProfileJson.profiles = new HashMap<>();