Fix loading errors GUI crashing when errors occur during construction
This commit is contained in:
parent
18400e8457
commit
d7ba9a50df
|
@ -87,7 +87,13 @@ public class ClientModLoader
|
||||||
GlStateManager.disableTexture2D();
|
GlStateManager.disableTexture2D();
|
||||||
GlStateManager.enableTexture2D();
|
GlStateManager.enableTexture2D();
|
||||||
List<ModLoadingWarning> warnings = ModLoader.get().getWarnings();
|
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
|
//User disabled warning screen, as least log them
|
||||||
if (!warnings.isEmpty()) {
|
if (!warnings.isEmpty()) {
|
||||||
LOGGER.warn(LOADING, "Mods loaded with {} warning(s)", warnings.size());
|
LOGGER.warn(LOADING, "Mods loaded with {} warning(s)", warnings.size());
|
||||||
|
|
Loading…
Reference in New Issue