mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-05 06:28:56 +00:00
Fix NPE when mute list is empty
This commit is contained in:
1 parent
39b429c370
commit
d929a5be71
1 file changed
+4
-1
@@ -83,9 +83,11 @@ public class MuteListCommand implements CommandExecutor {
|
||||
|
||||
// TODO Support paging through this list
|
||||
int count = 0;
|
||||
String players = "";
|
||||
|
||||
if (chan.hasMuteList()) {
|
||||
Iterator<String> iter = chan.getMuteList().iterator();
|
||||
boolean first = true;
|
||||
String players = "";
|
||||
while(iter.hasNext()) {
|
||||
if (!first) {
|
||||
players += Colors.Green + ", "+ Colors.White;
|
||||
@@ -93,6 +95,7 @@ public class MuteListCommand implements CommandExecutor {
|
||||
players += iter.next();
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
TownyMessaging.sendMsg(sender, "[TownyChat] There are no muted playeers in " + Colors.White + chan.getName());
|
||||
|
||||
Reference in new issue
Block a user