Fix crash when user home/config folders are inaccessible

This commit is contained in:
embeddedt 2026-01-09 21:05:49 -05:00
parent b2ed5b9341
commit 4b18cc2cc6
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -317,6 +317,7 @@ public class ModernFixEarlyConfig {
} }
private void readGlobalProperties() { private void readGlobalProperties() {
try {
Path minecraftFolder; Path minecraftFolder;
if (SystemUtils.IS_OS_MAC) { if (SystemUtils.IS_OS_MAC) {
minecraftFolder = Paths.get(System.getProperty("user.home"), "Library", "Application Support", "minecraft"); minecraftFolder = Paths.get(System.getProperty("user.home"), "Library", "Application Support", "minecraft");
@ -326,7 +327,6 @@ public class ModernFixEarlyConfig {
minecraftFolder = Paths.get(System.getProperty("user.home"), ".minecraft"); minecraftFolder = Paths.get(System.getProperty("user.home"), ".minecraft");
} }
Path globalPropsFile = minecraftFolder.resolve("global").resolve("modernfix-global-mixins.properties"); Path globalPropsFile = minecraftFolder.resolve("global").resolve("modernfix-global-mixins.properties");
try {
if (Files.exists(globalPropsFile)) { if (Files.exists(globalPropsFile)) {
Properties properties = new Properties(); Properties properties = new Properties();
try (var is = Files.newInputStream(globalPropsFile)) { try (var is = Files.newInputStream(globalPropsFile)) {