Skip to content

Commit 8b6fef1

Browse files
committed
fix[PojavProfile.getAllProfiles()]: Fix crash when accounts.json is malformed
1 parent 7670c5c commit 8b6fef1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/PojavProfile.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public static String getCurrentProfileName(Context ctx) {
4040
public static List<MinecraftAccount> getAllProfiles(){
4141
List<MinecraftAccount> mcAccountList = new ArrayList<>();;
4242
for (String accountName : getAllProfilesList()){
43-
mcAccountList.add(MinecraftAccount.load(accountName));
43+
if (MinecraftAccount.load(accountName) != null) {
44+
mcAccountList.add(MinecraftAccount.load(accountName));
45+
}
4446
}
4547
return mcAccountList;
4648
}

0 commit comments

Comments
 (0)