fix NPE on EntityTeleportEvent getTo (#10016)

This commit is contained in:
Jake Potrebic
2023-12-26 11:22:41 -08:00
parent dce06a986f
commit 7ecbd18f48
3 changed files with 68 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ this, this.getLocation(), location);
+ // cancelling the event is handled differently for players and entities,
+ // entities just stop teleporting, players will still teleport to the "from" location of the event
+ if (!event.callEvent()) {
+ if (!event.callEvent() || event.getTo() == null) {
+ return false;
+ }
+ location = event.getTo();