Fix NullPointerException in Room getStackHeight

This commit is contained in:
Beny 2019-05-15 18:00:43 +01:00
parent efe1fd2258
commit 6f4105ceb9

View File

@ -4294,7 +4294,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable
public double getStackHeight(short x, short y, boolean calculateHeightmap, HabboItem exclude) public double getStackHeight(short x, short y, boolean calculateHeightmap, HabboItem exclude)
{ {
if(x < 0 || y < 0) if(x < 0 || y < 0 || this.layout == null)
return calculateHeightmap ? Short.MAX_VALUE : 0.0; return calculateHeightmap ? Short.MAX_VALUE : 0.0;
double height = this.layout.getHeightAtSquare(x, y); double height = this.layout.getHeightAtSquare(x, y);