Skip to content

Commit 945cae7

Browse files
committed
1.1.12: Correct onProxyDisconnect logic
1 parent 9296612 commit 945cae7

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.11
1+
1.1.12

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins {
99
}
1010

1111
setGroup("net.elytrium")
12-
setVersion("1.1.11")
12+
setVersion("1.1.12")
1313

1414
compileJava {
1515
getOptions().setEncoding("UTF-8")

src/main/java/net/elytrium/limbofilter/listener/FilterListener.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.velocitypowered.api.event.proxy.ProxyPingEvent;
2525
import com.velocitypowered.api.event.query.ProxyQueryEvent;
2626
import com.velocitypowered.api.proxy.Player;
27+
import java.net.InetSocketAddress;
2728
import net.elytrium.limboapi.api.event.LoginLimboRegisterEvent;
2829
import net.elytrium.limbofilter.LimboFilter;
2930
import net.elytrium.limbofilter.Settings;
@@ -49,9 +50,12 @@ public void onProxyConnect(PreLoginEvent event) {
4950

5051
@Subscribe
5152
public void onProxyDisconnect(DisconnectEvent event) {
52-
Statistics statistics = this.plugin.getStatistics();
53-
if (statistics != null) {
54-
statistics.removeAddress(event.getPlayer().getRemoteAddress().getAddress());
53+
InetSocketAddress address = event.getPlayer().getRemoteAddress();
54+
if (address != null) {
55+
Statistics statistics = this.plugin.getStatistics();
56+
if (statistics != null) {
57+
statistics.removeAddress(address.getAddress());
58+
}
5559
}
5660
}
5761

0 commit comments

Comments
 (0)