From 605646a84cf9ffc4d77bdbb419f21a3eab0068ba Mon Sep 17 00:00:00 2001 From: Max Weber Date: Wed, 25 Apr 2018 19:11:19 -0600 Subject: [PATCH] tithefarmplugin: Fix null pointer when crops near camera --- .../client/plugins/tithefarm/TitheFarmPlantOverlay.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/tithefarm/TitheFarmPlantOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/tithefarm/TitheFarmPlantOverlay.java index d9c113f715..5e43809c46 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/tithefarm/TitheFarmPlantOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/tithefarm/TitheFarmPlantOverlay.java @@ -64,8 +64,12 @@ public class TitheFarmPlantOverlay extends Overlay for (TitheFarmPlant plant : plugin.getPlants()) { 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()); - if (viewport != null && localLocation != null) + if (viewport != null && canvasLocation != null) { switch (plant.getState()) {