Skip to content

Commit 1bd89aa

Browse files
Ensure entity is not null when updating
1 parent b630f9d commit 1bd89aa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/parallelmc/parallelutils/modules/custommobs/registry/EntityRegistry.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@ public void run() {
185185
);
186186

187187
Entity entity = ed.entity;
188+
189+
if (entity == null) {
190+
Parallelutils.log(Level.WARNING, "Entity is null. Will not update!");
191+
statement.close();
192+
conn.close();
193+
return;
194+
}
195+
188196
CraftEntity craftEntity = entity.getBukkitEntity();
189197

190198
String uuid = craftEntity.getUniqueId().toString();

0 commit comments

Comments
 (0)