From e95971ee12531b14246d9a31eff0c8b4e66bfe18 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:52:41 +0200 Subject: Fixed NPE (#389) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../github/moulberry/notenoughupdates/listener/ChatListener.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index d4e98ba7..62937afc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -127,8 +127,13 @@ public class ChatListener { if (chatComponent.getSiblings().get(0).getChatStyle().getChatClickEvent().getValue().startsWith("/viewprofile")) { startsWith = "/viewprofile"; partyOrGuildChat = true; - } else if (chatComponent.getChatStyle().getChatClickEvent().getValue().startsWith("/socialoptions")) { - startsWith = "/socialoptions"; + } else { + ClickEvent chatClickEvent = chatComponent.getChatStyle().getChatClickEvent(); + if (chatClickEvent != null) { + if (chatClickEvent.getValue().startsWith("/socialoptions")) { + startsWith = "/socialoptions"; + } + } } if (startsWith != null) { -- cgit