aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2022-10-21 14:52:41 +0200
committerGitHub <noreply@github.com>2022-10-21 14:52:41 +0200
commite95971ee12531b14246d9a31eff0c8b4e66bfe18 (patch)
treeaedef23d0aca5ed022a3016604615b89d208986c /src
parent336cbfb4c275528baf9f3ffc7a62c0eaa310e76f (diff)
downloadNotEnoughUpdates-e95971ee12531b14246d9a31eff0c8b4e66bfe18.tar.gz
NotEnoughUpdates-e95971ee12531b14246d9a31eff0c8b4e66bfe18.tar.bz2
NotEnoughUpdates-e95971ee12531b14246d9a31eff0c8b4e66bfe18.zip
Fixed NPE (#389)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java9
1 files 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) {