From bfa6d6fa0760131ac0180925deaafccdce5a4076 Mon Sep 17 00:00:00 2001 From: Pepich Date: Thu, 2 Mar 2017 19:29:33 +0100 Subject: [PATCH] Fixed unchecked cast resulting in error when console leaves chatgroups --- src/com/redstoner/modules/chatgroups/Chatgroups.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/redstoner/modules/chatgroups/Chatgroups.java b/src/com/redstoner/modules/chatgroups/Chatgroups.java index f9be5e1..d0a3c89 100644 --- a/src/com/redstoner/modules/chatgroups/Chatgroups.java +++ b/src/com/redstoner/modules/chatgroups/Chatgroups.java @@ -26,7 +26,7 @@ import com.redstoner.modules.Module; * * @author Pepich */ @AutoRegisterListener -@Version(major = 1, minor = 3, revision = 0, compatible = 1) +@Version(major = 1, minor = 3, revision = 1, compatible = 1) public class Chatgroups implements Module, Listener { private static final char defaultKey = ':'; @@ -229,7 +229,8 @@ public class Chatgroups implements Module, Listener name = sender.getName(); sendToGroup(removeGroup(sender), "&9" + name + " &7left the group!"); Utils.sendMessage(sender, null, "Successfully removed you from your group!"); - cgtoggled.remove(((Player) sender).getUniqueId()); + if (sender instanceof Player) + cgtoggled.remove(((Player) sender).getUniqueId()); return true; }