mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 14:38:58 +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
|
// TODO Support paging through this list
|
||||||
int count = 0;
|
int count = 0;
|
||||||
Iterator<String> iter = chan.getMuteList().iterator();
|
|
||||||
boolean first = true;
|
|
||||||
String players = "";
|
String players = "";
|
||||||
while(iter.hasNext()) {
|
|
||||||
if (!first) {
|
if (chan.hasMuteList()) {
|
||||||
players += Colors.Green + ", "+ Colors.White;
|
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) {
|
if (count == 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user