woodcutting plugin: fix npe rendering redwood trees if axe is null

This commit is contained in:
Adam
2018-08-27 20:31:26 -04:00
parent 9c4c4c0092
commit 031b53b11d

View File

@@ -62,11 +62,16 @@ class WoodcuttingTreesOverlay extends Overlay
return null; return null;
} }
Axe axe = plugin.getAxe();
if (axe == null)
{
return null;
}
for (GameObject treeObject : plugin.getTreeObjects()) for (GameObject treeObject : plugin.getTreeObjects())
{ {
if (treeObject.getWorldLocation().distanceTo(client.getLocalPlayer().getWorldLocation()) <= 12) if (treeObject.getWorldLocation().distanceTo(client.getLocalPlayer().getWorldLocation()) <= 12)
{ {
Axe axe = plugin.getAxe();
OverlayUtil.renderImageLocation(client, graphics, treeObject.getLocalLocation(), itemManager.getImage(axe.getItemId()), 120); OverlayUtil.renderImageLocation(client, graphics, treeObject.getLocalLocation(), itemManager.getImage(axe.getItemId()), 120);
} }
} }