Skip to content

Commit ac66618

Browse files
benniofficialdevJRoy
andauthored
Fix error when running /helpop from console (#6385)
Fixes #6342 --------- Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
1 parent b349517 commit ac66618

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Essentials/src/main/java/com/earth2me/essentials/commands/Commandhelpop.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ private void sendMessage(final IMessageRecipient from, final String[] args) thro
5151
final HelpopMessageSendEvent sendEvent = new HelpopMessageSendEvent(from, recipients, message);
5252
ess.getServer().getPluginManager().callEvent(sendEvent);
5353

54-
final IUser sender = (IUser) from;
55-
if(!recipients.contains(sender)){
56-
from.sendTl("helpOp", from.getDisplayName(), message);
54+
if (from instanceof IUser) {
55+
final IUser sender = (IUser) from;
56+
if (!recipients.contains(sender)) {
57+
from.sendTl("helpOp", from.getDisplayName(), message);
58+
}
5759
}
5860

5961
for (IUser recipient : sendEvent.getRecipients()) {

0 commit comments

Comments
 (0)