Ensure new movement location is not null, fixes #1256

This commit is contained in:
PikaMug 2020-04-25 15:49:21 -04:00
parent 3172af635e
commit fcb1078f29

View File

@ -818,10 +818,10 @@ public class PlayerListener implements Listener {
@EventHandler @EventHandler
public void onPlayerMove(PlayerMoveEvent evt) { public void onPlayerMove(PlayerMoveEvent evt) {
if (evt.getFrom().getBlock().equals(evt.getTo().getBlock())) { if (evt.getPlayer() == null || evt.getTo() == null) {
return; return;
} }
if (evt.getPlayer() == null) { if (evt.getFrom().getBlock().equals(evt.getTo().getBlock())) {
return; return;
} }
if (plugin.getDependencies().getCitizens() != null) { if (plugin.getDependencies().getCitizens() != null) {