Fix loading errors GUI crashing when errors occur during construction

This commit is contained in:
tterrag 2019-03-22 20:58:10 -04:00
parent 18400e8457
commit d7ba9a50df
1 changed files with 7 additions and 1 deletions

View File

@ -87,7 +87,13 @@ public class ClientModLoader
GlStateManager.disableTexture2D();
GlStateManager.enableTexture2D();
List<ModLoadingWarning> warnings = ModLoader.get().getWarnings();
if (!ForgeConfig.CLIENT.showLoadWarnings.get()) {
boolean showWarnings = true;
try {
showWarnings = ForgeConfig.CLIENT.showLoadWarnings.get();
} catch (NullPointerException e) {
// We're in an early error state, config is not available. Assume true.
}
if (!showWarnings) {
//User disabled warning screen, as least log them
if (!warnings.isEmpty()) {
LOGGER.warn(LOADING, "Mods loaded with {} warning(s)", warnings.size());