fix potential error from issue #9

This commit is contained in:
Pyrbu 2023-04-21 14:04:07 +01:00
parent e197dec091
commit 8440795597

@ -52,18 +52,17 @@ public class ZUser {
private static class ChannelRegistrationFallbackTask extends BukkitRunnable {
private final ZUser user;
private final Player player;
private int tries = 5;
private ChannelRegistrationFallbackTask(ZUser user) {
this.user = user;
this.player = user.toPlayer();
}
@Override
public void run() {
Exception ex = user.tryRegisterChannel();
if (!player.isOnline() || ex == null) {
Player player = user.toPlayer();
if (player == null || !player.isOnline() || ex == null) {
cancel();
return;
}