agility plugin: fix exception if obstacle is off screen

This commit is contained in:
Adam
2018-05-11 16:48:04 -04:00
parent d5d5f4890d
commit bdf6532471

View File

@@ -81,7 +81,11 @@ public class AgilityOverlay extends Overlay
// This assumes that the obstacle is not clickable.
if (Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()))
{
OverlayUtil.renderPolygon(graphics, object.getCanvasTilePoly(), config.getTrapColor());
Polygon polygon = object.getCanvasTilePoly();
if (polygon != null)
{
OverlayUtil.renderPolygon(graphics, polygon, config.getTrapColor());
}
return;
}