Skip to content

Commit

Permalink
Null check
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchej123 committed Nov 17, 2024
1 parent 912e0e8 commit 60ab3b7
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -129,7 +129,8 @@ private void disableIncompatibleMods() {
final Set<Config> 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);
}
Expand All @@ -142,7 +143,8 @@ private void disableIncompatibleMods() {
containersField.setAccessible(true);
final Map<IContainerHandle, MixinContainer> containers = (Map<IContainerHandle, MixinContainer>) containersField.get(platformManager);
for (Map.Entry<IContainerHandle, MixinContainer> 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());
}
Expand Down

0 comments on commit 60ab3b7

Please sign in to comment.