add null check to getEntity API

This commit is contained in:
Aikar 2016-03-30 21:56:07 -04:00
parent 9fc220ea02
commit 4e89e1f0c7

View file

@ -17,6 +17,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public Entity getEntity(UUID uuid) { + public Entity getEntity(UUID uuid) {
+ Entity entity; + Entity entity;
+ for (WorldServer world : worldServer) { + for (WorldServer world : worldServer) {
+ if (world == null) {
+ continue;
+ }
+ entity = world.getEntity(uuid); + entity = world.getEntity(uuid);
+ if (entity != null && !entity.dead) { + if (entity != null && !entity.dead) {
+ return entity; + return entity;