diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java index 41c2219a..0abd5216 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CookieWarning.java @@ -34,7 +34,12 @@ public class CookieWarning { */ private void checkCookie() { if(!hasNotified && NotEnoughUpdates.INSTANCE.config.notifications.doBoosterNotif) { - String[] lines = ((AccessorGuiPlayerTabOverlay) Minecraft.getMinecraft().ingameGUI.getTabList()).getFooter().getUnformattedText().split("\n"); + String[] lines = {}; + try { + lines = ((AccessorGuiPlayerTabOverlay) Minecraft.getMinecraft().ingameGUI.getTabList()).getFooter().getUnformattedText().split("\n"); + } catch(NullPointerException e) { + return; // if the footer is null or somehow doesn't exist, stop + } boolean hasCookie = true; String timeLine = null; // the line that contains the cookie timer for(int i = 0; i < lines.length; i++) { @@ -89,7 +94,7 @@ public class CookieWarning { ), true, true); hasNotified = true; } - } + } } } } |