From 935e5bb300584e05a07794da3dfe116ef7ecbb1d Mon Sep 17 00:00:00 2001 From: Defective Date: Fri, 3 May 2024 09:39:45 +0200 Subject: [PATCH] Fix NullPointerException on Bungee --- .../authmeproxy/bungee/listeners/BungeeMessageListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bungee-plugin/src/main/java/io/github/defective4/authmeproxy/bungee/listeners/BungeeMessageListener.java b/bungee-plugin/src/main/java/io/github/defective4/authmeproxy/bungee/listeners/BungeeMessageListener.java index 4865b05..bd6ae88 100644 --- a/bungee-plugin/src/main/java/io/github/defective4/authmeproxy/bungee/listeners/BungeeMessageListener.java +++ b/bungee-plugin/src/main/java/io/github/defective4/authmeproxy/bungee/listeners/BungeeMessageListener.java @@ -8,6 +8,7 @@ import io.github.defective4.authmeproxy.common.config.ProxyConfigProperties; import io.github.defective4.authmeproxy.common.config.SettingsDependent; import net.md_5.bungee.api.ProxyServer; +import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.Server; import net.md_5.bungee.api.event.PluginMessageEvent; @@ -101,7 +102,8 @@ private void handleOnLogout(final ByteArrayDataInput in) { if (isSendOnLogoutEnabled) { final ProxiedPlayer player = authPlayer.getPlayer(); if (player != null) { - player.connect(ProxyServer.getInstance().getServerInfo(sendOnLogoutTarget)); + ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(sendOnLogoutTarget); + if (serverInfo != null) player.connect(serverInfo); } } }