From 4e89e1f0c70d6b89b97b35f88429bd4a205ecdf9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 30 Mar 2016 21:56:07 -0400 Subject: [PATCH] add null check to getEntity API --- Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch b/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch index f7ddf0e238..59a588c444 100644 --- a/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch +++ b/Spigot-Server-Patches/Add-getEntity-by-UUID-API.patch @@ -17,6 +17,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public Entity getEntity(UUID uuid) { + Entity entity; + for (WorldServer world : worldServer) { ++ if (world == null) { ++ continue; ++ } + entity = world.getEntity(uuid); + if (entity != null && !entity.dead) { + return entity;