From ddaf3c84d36f55fc4a80793dd41e64d711fb1c93 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Thu, 22 Mar 2012 18:54:30 -0400 Subject: [PATCH] Fixed Connection Throttle handling. Fixes BUKKIT-1279 --- .../java/net/minecraft/server/NetworkAcceptThread.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/NetworkAcceptThread.java b/src/main/java/net/minecraft/server/NetworkAcceptThread.java index 2937aee833..75985a3c0a 100644 --- a/src/main/java/net/minecraft/server/NetworkAcceptThread.java +++ b/src/main/java/net/minecraft/server/NetworkAcceptThread.java @@ -26,7 +26,13 @@ class NetworkAcceptThread extends Thread { if (socket != null) { synchronized (NetworkListenThread.getRecentConnectionAttempts(this.listenThread)) { InetAddress inetaddress = socket.getInetAddress(); - connectionThrottle = this.a.server.getConnectionThrottle(); // CraftBukkit + // CraftBukkit start + if (this.a.server == null) { + socket.close(); + continue; + } + connectionThrottle = this.a.server.getConnectionThrottle(); + // CraftBukkit end // CraftBukkit if (NetworkListenThread.getRecentConnectionAttempts(this.listenThread).containsKey(inetaddress) && System.currentTimeMillis() - ((Long) NetworkListenThread.getRecentConnectionAttempts(this.listenThread).get(inetaddress)).longValue() < connectionThrottle) {