diff --git a/src/de/steamwar/bungeecore/listeners/TablistManager.java b/src/de/steamwar/bungeecore/listeners/TablistManager.java index 91aac7e..e7fc6ca 100644 --- a/src/de/steamwar/bungeecore/listeners/TablistManager.java +++ b/src/de/steamwar/bungeecore/listeners/TablistManager.java @@ -146,12 +146,13 @@ public class TablistManager extends BasicListener { } private void refresh(){ - ServerInfo currentServer = player.getServer().getInfo(); - setHeader(header); - setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms"); - setSize(size, 20); try { + ServerInfo currentServer = player.getServer().getInfo(); + setHeader(header); + setFooter("§e" + currentServer.getName() + " " + getPing() + "§8ms"); + setSize(size, 20); + int i = 0; for (String server : playerMap.navigableKeySet()) { if (i > 0){ @@ -173,8 +174,9 @@ public class TablistManager extends BasicListener { setSlot(i%20, i/20, darkGray, "", 1000); i++; } - }catch(IndexOutOfBoundsException e){ - //Ignore + }catch(IndexOutOfBoundsException | NullPointerException e){ + //Ignore IndexOutOfBoundsException + //Ignore NPE, happens sometimes (only 1s long) when somebody is joining, server switching or disconnecting } } }