Hotfix Tablist NPE
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
839d534f55
Commit
889484d1fd
@ -146,12 +146,13 @@ public class TablistManager extends BasicListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refresh(){
|
private void refresh(){
|
||||||
ServerInfo currentServer = player.getServer().getInfo();
|
|
||||||
setHeader(header);
|
|
||||||
setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms");
|
|
||||||
setSize(size, 20);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
ServerInfo currentServer = player.getServer().getInfo();
|
||||||
|
setHeader(header);
|
||||||
|
setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms");
|
||||||
|
setSize(size, 20);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (String server : playerMap.navigableKeySet()) {
|
for (String server : playerMap.navigableKeySet()) {
|
||||||
if (i > 0){
|
if (i > 0){
|
||||||
@ -173,8 +174,9 @@ public class TablistManager extends BasicListener {
|
|||||||
setSlot(i%20, i/20, darkGray, "", 1000);
|
setSlot(i%20, i/20, darkGray, "", 1000);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}catch(IndexOutOfBoundsException e){
|
}catch(IndexOutOfBoundsException | NullPointerException e){
|
||||||
//Ignore
|
//Ignore IndexOutOfBoundsException
|
||||||
|
//Ignore NPE, happens sometimes (only 1s long) when somebody is joining, server switching or disconnecting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren