add null check for vehicle

This commit is contained in:
DNx5 2015-09-20 22:58:54 +07:00
parent 5247b5aa2c
commit accd209e84

View File

@ -43,11 +43,8 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
}
BukkitTask msgT = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
try {
if (player.isInsideVehicle())
player.getVehicle().eject();
} catch (NullPointerException npe) {
}
if (player.isInsideVehicle() && player.getVehicle() != null)
player.getVehicle().eject();
if (Settings.applyBlindEffect)
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
player.setOp(false);