mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
Fix NPEs when replying to non-existent targets
This commit is contained in:
1 parent
0d4636a940
commit
236055b1a7
1 file changed
+2
-1
@@ -24,7 +24,6 @@ public class ReplyCommand extends BaseCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ChatUser user = carbonChat.getUserService().wrap(player);
|
ChatUser user = carbonChat.getUserService().wrap(player);
|
||||||
ChatUser targetUser = carbonChat.getUserService().wrap(user.getReplyTarget());
|
|
||||||
|
|
||||||
if (user.getReplyTarget() == null) {
|
if (user.getReplyTarget() == null) {
|
||||||
String message = carbonChat.getConfig().getString("language.no-reply-target");
|
String message = carbonChat.getConfig().getString("language.no-reply-target");
|
||||||
@@ -34,6 +33,8 @@ public class ReplyCommand extends BaseCommand {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ChatUser targetUser = carbonChat.getUserService().wrap(user.getReplyTarget());
|
||||||
|
|
||||||
targetUser.sendMessage(user, String.join(" ", args));
|
targetUser.sendMessage(user, String.join(" ", args));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user