Prevent missing options from crashing the game

This commit is contained in:
embeddedt 2023-04-16 12:55:52 -04:00
parent 6f176ba86d
commit 0f3c701d2a
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -87,7 +87,11 @@ public class ModernFixEarlyConfig {
private void disableIfModPresent(String configName, String... ids) {
for(String id : ids) {
if(FMLLoader.getLoadingModList().getModFileById(id) != null) {
this.options.get(configName).addModOverride(false, id);
Option option = this.options.get(configName);
if(option != null)
option.addModOverride(false, id);
else
LOGGER.warn("Can't disable missing option {}", configName);
}
}
}