From df57e0a1bad8e18e302db074e6d74a07aadc453a Mon Sep 17 00:00:00 2001 From: Take Weiland Date: Mon, 6 Jul 2020 22:06:31 +0200 Subject: [PATCH] Fix missing null checks in ForgeIngameGui (#6907) --- .../minecraftforge/client/gui/ForgeIngameGui.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java index 23eba3445..ac2cece1a 100644 --- a/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java +++ b/src/main/java/net/minecraftforge/client/gui/ForgeIngameGui.java @@ -695,7 +695,7 @@ public class ForgeIngameGui extends IngameGui protected void renderTitle(int width, int height, float partialTicks, MatrixStack mStack) { - if (titlesTimer > 0) + if (displayedTitle != null && titlesTimer > 0) { mc.getProfiler().startSection("titleAndSubtitle"); float age = (float)this.titlesTimer - partialTicks; @@ -721,10 +721,13 @@ public class ForgeIngameGui extends IngameGui int l = opacity << 24 & -16777216; this.getFontRenderer().func_238407_a_(mStack, this.displayedTitle, (float)(-this.getFontRenderer().func_238414_a_(this.displayedTitle) / 2), -10.0F, 16777215 | l); RenderSystem.popMatrix(); - RenderSystem.pushMatrix(); - RenderSystem.scalef(2.0F, 2.0F, 2.0F); - this.getFontRenderer().func_238407_a_(mStack, this.displayedSubTitle, (float)(-this.getFontRenderer().func_238414_a_(this.displayedSubTitle) / 2), 5.0F, 16777215 | l); - RenderSystem.popMatrix(); + if (this.displayedSubTitle != null) + { + RenderSystem.pushMatrix(); + RenderSystem.scalef(2.0F, 2.0F, 2.0F); + this.getFontRenderer().func_238407_a_(mStack, this.displayedSubTitle, (float)(-this.getFontRenderer().func_238414_a_(this.displayedSubTitle) / 2), 5.0F, 16777215 | l); + RenderSystem.popMatrix(); + } RenderSystem.disableBlend(); RenderSystem.popMatrix(); }