Check if the passenger is null before trying to update metadata (#1001)

* Check if the passenger is null before trying to update metadata

* Fix variable name
This commit is contained in:
rtm516 2020-07-30 17:19:26 +01:00 committed by GitHub
parent b7f0780a56
commit 0c3a6f1a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,10 @@ public class StriderEntity extends AnimalEntity {
// Update the passengers if we have any
for (long passenger : passengers) {
session.getEntityCache().getEntityByJavaId(passenger).updateBedrockMetadata(session);
Entity passengerEntity = session.getEntityCache().getEntityByJavaId(passenger);
if (passengerEntity != null) {
passengerEntity.updateBedrockMetadata(session);
}
}
super.updateBedrockMetadata(session);