From 1fec0d019215df8c57d410c18bd06445d8c2ded7 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 00:23:14 +1000 Subject: Fix crash related to profile viewer button (#272) --- .../io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index 7c3414fa..be36d0b4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -96,7 +96,7 @@ public abstract class MixinGuiContainer extends GuiScreen { if (tag.hasKey("SkullOwner") && tag.getCompoundTag("SkullOwner").hasKey("Name")) { String tagName = tag.getCompoundTag("SkullOwner").getString("Name"); String displayName = Utils.cleanColour(cc.inventorySlots.get(22).getStack().getDisplayName()); - if (tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { + if (displayName.length() - tagName.length() > 0 && tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { ci.cancel(); this.zLevel = 100.0F; -- cgit