tithefarmplugin: Fix null pointer when crops near camera

This commit is contained in:
Max Weber
2018-04-25 19:11:19 -06:00
parent de7c495c4d
commit 605646a84c

View File

@@ -64,8 +64,12 @@ public class TitheFarmPlantOverlay extends Overlay
for (TitheFarmPlant plant : plugin.getPlants()) for (TitheFarmPlant plant : plugin.getPlants())
{ {
LocalPoint localLocation = LocalPoint.fromWorld(client, plant.getWorldLocation()); LocalPoint localLocation = LocalPoint.fromWorld(client, plant.getWorldLocation());
if (localLocation == null)
{
continue;
}
net.runelite.api.Point canvasLocation = Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), client.getPlane()); net.runelite.api.Point canvasLocation = Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), client.getPlane());
if (viewport != null && localLocation != null) if (viewport != null && canvasLocation != null)
{ {
switch (plant.getState()) switch (plant.getState())
{ {