mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix NPE when temp ip bans expire (#3373)
This commit is contained in:
parent
acbe459f57
commit
0219f4acd4
1 changed files with 13 additions and 0 deletions
|
@ -98,3 +98,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
Collection<V> collection = this.d.values();
|
||||
String s = this.b.toJson(collection);
|
||||
BufferedWriter bufferedwriter = null;
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
} else if (!this.isWhitelisted(gameprofile, event)) { // Paper
|
||||
chatmessage = new ChatMessage("multiplayer.disconnect.not_whitelisted", new Object[0]);
|
||||
//event.disallow(PlayerLoginEvent.Result.KICK_WHITELIST, org.spigotmc.SpigotConfig.whitelistMessage); // Spigot // Paper - moved to isWhitelisted
|
||||
- } else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) {
|
||||
+ } else if (getIPBans().isBanned(socketaddress) && getIPBans().get(socketaddress) != null && !getIPBans().get(socketaddress).hasExpired()) { // Paper - fix NPE with temp ip bans
|
||||
IpBanEntry ipbanentry = this.l.get(socketaddress);
|
||||
|
||||
chatmessage = new ChatMessage("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()});
|
||||
|
|
Loading…
Reference in a new issue