2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-22 20:28:00 +00:00

fix null being passed into jedis on ServerConnectedEvent

This commit is contained in:
mohammed jasem alaajel 2022-07-20 13:25:26 +04:00
parent 9da5845da3
commit c787c76eca
2 changed files with 2 additions and 3 deletions

View File

@ -165,7 +165,7 @@ public class RedisBungeeBungeeListener extends AbstractRedisBungeeListener<Login
@Override @Override
@EventHandler @EventHandler
public void onServerChange(ServerConnectedEvent event) { public void onServerChange(ServerConnectedEvent event) {
final String currentServer = event.getPlayer().getServer() == null ? null : event.getPlayer().getServer().getInfo().getName(); final String currentServer = event.getServer().getInfo().getName();
final String oldServer = event.getPlayer().getServer() == null ? null : event.getPlayer().getServer().getInfo().getName(); final String oldServer = event.getPlayer().getServer() == null ? null : event.getPlayer().getServer().getInfo().getName();
plugin.executeAsync(new RedisTask<Void>(plugin) { plugin.executeAsync(new RedisTask<Void>(plugin) {
@Override @Override

View File

@ -157,8 +157,7 @@ public class RedisBungeeVelocityListener extends AbstractRedisBungeeListener<Log
@Override @Override
@Subscribe @Subscribe
public void onServerChange(ServerConnectedEvent event) { public void onServerChange(ServerConnectedEvent event) {
Optional<ServerConnection> optionalServerConnection = event.getPlayer().getCurrentServer(); final String currentServer = event.getServer().getServerInfo().getName();
final String currentServer = optionalServerConnection.map(serverConnection -> serverConnection.getServerInfo().getName()).orElse(null);
final String oldServer = event.getPreviousServer().map(serverConnection -> serverConnection.getServerInfo().getName()).orElse(null); final String oldServer = event.getPreviousServer().map(serverConnection -> serverConnection.getServerInfo().getName()).orElse(null);
plugin.executeAsync(new RedisTask<Void>(plugin) { plugin.executeAsync(new RedisTask<Void>(plugin) {