Fix a NullPointerException in Room.getItemsAt

This commit is contained in:
Alejandro 2019-05-18 18:47:28 +03:00
parent e15ea51c63
commit 0e73506278

View File

@ -4047,6 +4047,9 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
THashSet<HabboItem> items = new THashSet<>(0); THashSet<HabboItem> items = new THashSet<>(0);
if (tile == null)
return items;
TIntObjectIterator<HabboItem> iterator = this.roomItems.iterator(); TIntObjectIterator<HabboItem> iterator = this.roomItems.iterator();
for (int i = this.roomItems.size(); i-- > 0; ) for (int i = this.roomItems.size(); i-- > 0; )
@ -4062,6 +4065,9 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
break; break;
} }
if (item == null)
continue;
if (item.getBaseItem().getType() != FurnitureType.FLOOR) if (item.getBaseItem().getType() != FurnitureType.FLOOR)
continue; continue;