fix[PojavProfile.getAllProfiles()]: Fix crash when accounts.json is malformed

This commit is contained in:
alexytomi 2025-06-30 18:36:02 +08:00
parent 7670c5cf89
commit 8b6fef135e

View File

@ -40,7 +40,9 @@ public class PojavProfile {
public static List<MinecraftAccount> getAllProfiles(){
List<MinecraftAccount> mcAccountList = new ArrayList<>();;
for (String accountName : getAllProfilesList()){
mcAccountList.add(MinecraftAccount.load(accountName));
if (MinecraftAccount.load(accountName) != null) {
mcAccountList.add(MinecraftAccount.load(accountName));
}
}
return mcAccountList;
}