From 60ab3b7900b559a1154eab9e9df9059c123c3c2e Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sun, 17 Nov 2024 08:17:24 -0800 Subject: [PATCH] Null check --- .../angelica/loading/MixinCompatHackTweaker.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gtnewhorizons/angelica/loading/MixinCompatHackTweaker.java b/src/main/java/com/gtnewhorizons/angelica/loading/MixinCompatHackTweaker.java index ef939bb6f..5e113f6a1 100644 --- a/src/main/java/com/gtnewhorizons/angelica/loading/MixinCompatHackTweaker.java +++ b/src/main/java/com/gtnewhorizons/angelica/loading/MixinCompatHackTweaker.java @@ -119,7 +119,7 @@ private void disableIncompatibleMods() { if (mixinConfigsDefault != null) { for (int idx = mixinConfigsDefault.size() - 1; idx >= 0; idx--) { final String name = mixinConfigsDefault.get(idx); - if (name.contains("optimizationsandtweaks")) { + if (name != null && name.contains("optimizationsandtweaks")) { LOGGER.info("Removing mixin config " + name); mixinConfigsDefault.remove(idx); } @@ -129,7 +129,8 @@ private void disableIncompatibleMods() { final Set toRemove = new HashSet<>(); if (mixinConfigs != null) { for (Config config : mixinConfigs) { - if (config.getName().contains("optimizationsandtweaks")) { + final String name = config.getName(); + if (name != null && name.contains("optimizationsandtweaks")) { LOGGER.info("Removing queued mixin config " + config.getName()); toRemove.add(config); } @@ -142,7 +143,8 @@ private void disableIncompatibleMods() { containersField.setAccessible(true); final Map containers = (Map) containersField.get(platformManager); for (Map.Entry entry : containers.entrySet()) { - if(entry.getKey().getAttribute("MixinConfigs").contains("optimizationsandtweaks")) { + final String attribute = entry.getKey().getAttribute("MixinConfigs"); + if(attribute != null && attribute.contains("optimizationsandtweaks")) { LOGGER.info("Removing mixin container " + entry.getKey().toString()); containers.remove(entry.getKey()); }