Skip to content

Commit

Permalink
Add null check to clicking coupled stock
Browse files Browse the repository at this point in the history
  • Loading branch information
cam72cam committed Oct 6, 2023
1 parent f9b32e8 commit b3781fc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public ClickResult onClick(Player player, Player.Hand hand) {
player.sendMessage(ChatText.COUPLER_DISENGAGED.getMessage(coupler));
}
} else {
if (this.isCoupled(coupler) && this.isCouplerEngaged(coupler)) {
EntityCoupleableRollingStock coupled = this.getCoupled(coupler);
EntityCoupleableRollingStock coupled = this.getCoupled(coupler);
if (this.isCoupled(coupler) && this.isCouplerEngaged(coupler) && coupled != null) {
player.sendMessage(ChatText.COUPLER_STATUS_COUPLED.getMessage(
coupler,
coupled.getDefinition().name(),
Expand Down

0 comments on commit b3781fc

Please sign in to comment.