Adds null checks to draw function.
@@ -92,10 +92,13 @@ public class Component {
final Tile componentTile = tiles.getTileAt(x, y);
final Tile screenTile = grid.getTileAt(xPosition, yPosition);
+
+ if (componentTile != null && screenTile != null) {
screenTile.copy(componentTile);
}
}
}
+ }
/**
* Determines whether or not a point intersects this component.
