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

View file

@ -78,7 +78,10 @@ public class StriderEntity extends AnimalEntity {
// Update the passengers if we have any // Update the passengers if we have any
for (long passenger : passengers) { 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); super.updateBedrockMetadata(session);