Fixing NPE
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
861d87e259
Commit
771ad5575d
@ -9,6 +9,7 @@ import de.steamwar.bungeecore.Subserver;
|
|||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.config.ServerInfo;
|
import net.md_5.bungee.api.config.ServerInfo;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
|
import net.md_5.bungee.api.connection.Server;
|
||||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
@ -79,13 +80,16 @@ public class TablistManager extends BasicListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void updateCustomTablist(){
|
private synchronized void updateCustomTablist(){
|
||||||
try{
|
|
||||||
calcHeader();
|
calcHeader();
|
||||||
|
|
||||||
//Calculate server-player-map
|
//Calculate server-player-map
|
||||||
playerMap.clear();
|
playerMap.clear();
|
||||||
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
|
for(ProxiedPlayer player : ProxyServer.getInstance().getPlayers()){
|
||||||
ServerInfo server = player.getServer().getInfo();
|
Server pserver = player.getServer();
|
||||||
|
if(pserver == null) //Happens temporarily
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ServerInfo server = pserver.getInfo();
|
||||||
String serverName = server.getName();
|
String serverName = server.getName();
|
||||||
if(serverName.equals("Developer"))
|
if(serverName.equals("Developer"))
|
||||||
continue;
|
continue;
|
||||||
@ -111,9 +115,6 @@ public class TablistManager extends BasicListener {
|
|||||||
tablist.refresh();
|
tablist.refresh();
|
||||||
|
|
||||||
seconds++;
|
seconds++;
|
||||||
}catch(NullPointerException e){
|
|
||||||
ProxyServer.getInstance().getLogger().log(Level.SEVERE, "NPE", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren