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:
parent
9da5845da3
commit
c787c76eca
@ -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
|
||||||
|
@ -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) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user