mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-02 14:38:57 +00:00
Fix NPE when mute list is empty
This commit is contained in:
1 parent
39b429c370
commit
d929a5be71
1 file changed
+10
-7
@@ -83,15 +83,18 @@ public class MuteListCommand implements CommandExecutor {
|
||||
|
||||
// TODO Support paging through this list
|
||||
int count = 0;
|
||||
Iterator<String> iter = chan.getMuteList().iterator();
|
||||
boolean first = true;
|
||||
String players = "";
|
||||
while(iter.hasNext()) {
|
||||
if (!first) {
|
||||
players += Colors.Green + ", "+ Colors.White;
|
||||
|
||||
if (chan.hasMuteList()) {
|
||||
Iterator<String> iter = chan.getMuteList().iterator();
|
||||
boolean first = true;
|
||||
while(iter.hasNext()) {
|
||||
if (!first) {
|
||||
players += Colors.Green + ", "+ Colors.White;
|
||||
}
|
||||
players += iter.next();
|
||||
count++;
|
||||
}
|
||||
players += iter.next();
|
||||
count++;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
|
||||
Reference in new issue
Block a user