From 0c3a6f1a6a3d047c95ff06acc386010fcd6a9611 Mon Sep 17 00:00:00 2001 From: rtm516 Date: Thu, 30 Jul 2020 17:19:26 +0100 Subject: [PATCH] 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 --- .../connector/entity/living/animal/StriderEntity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/animal/StriderEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/animal/StriderEntity.java index ee6815d1..7c37db33 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/living/animal/StriderEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/living/animal/StriderEntity.java @@ -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);