Add a better check to cancel a non existing task...

#AutoInHacks T.T
This commit is contained in:
Xephi59 2015-06-11 00:55:46 +02:00
parent 4bb9dc53f1
commit a1c09aecfc

View File

@ -169,8 +169,10 @@ public class AsyncronousLogin {
// processed in other order.
ProcessSyncronousPlayerLogin syncronousPlayerLogin = new ProcessSyncronousPlayerLogin(player, plugin, database);
if (syncronousPlayerLogin.getLimbo() != null) {
syncronousPlayerLogin.getLimbo().getTimeoutTaskId().cancel();
syncronousPlayerLogin.getLimbo().getMessageTaskId().cancel();
if (syncronousPlayerLogin.getLimbo().getTimeoutTaskId() != null)
syncronousPlayerLogin.getLimbo().getTimeoutTaskId().cancel();
if (syncronousPlayerLogin.getLimbo().getMessageTaskId() != null)
syncronousPlayerLogin.getLimbo().getMessageTaskId().cancel();
}
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, syncronousPlayerLogin);
} else if (player.isOnline()) {