Skip to content

Commit

Permalink
Fixed issue with chairLoc being null
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Aug 24, 2016
1 parent 86c223b commit 9e7bd2f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/com/sk89q/craftbook/mechanics/Chair.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ private void addChair(final Player player, Block block, final Location chairLoc)
}

ar = fixArrow(block, ar);
ar.getLocation().setYaw(chairLoc.getYaw());
if (chairLoc != null)
ar.getLocation().setYaw(chairLoc.getYaw());

if (hasUpdated && ar != chairs.get(player.getName()).chairEntity)
isNew = true;
Expand All @@ -86,7 +87,8 @@ private void addChair(final Player player, Block block, final Location chairLoc)
Bukkit.getScheduler().runTask(CraftBookPlugin.inst(), new Runnable() {
@Override
public void run () {
player.teleport(chairLoc);
if (chairLoc != null)
player.teleport(chairLoc);
far.setPassenger(player);
}
});
Expand Down

0 comments on commit 9e7bd2f

Please sign in to comment.