Skip to content

Commit

Permalink
agility plugin: fix exception on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam- committed May 27, 2018
1 parent a40181a commit 75dee05
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import net.runelite.api.ItemID;
import net.runelite.api.ItemLayer;
import net.runelite.api.Node;
import net.runelite.api.Player;
import static net.runelite.api.Skill.AGILITY;
import net.runelite.api.Tile;
import net.runelite.api.TileObject;
Expand Down Expand Up @@ -266,7 +267,14 @@ public void onGameTick(GameTick tick)

private boolean isInAgilityArena()
{
return AGILITY_ARENA_REGION_ID == client.getLocalPlayer().getWorldLocation().getRegionID();
Player local = client.getLocalPlayer();
if (local == null)
{
return false;
}

WorldPoint location = local.getWorldLocation();
return location.getRegionID() == AGILITY_ARENA_REGION_ID;
}

private void removeAgilityArenaTimer()
Expand Down

0 comments on commit 75dee05

Please sign in to comment.