diff --git a/src/main/java/cam72cam/immersiverailroading/entity/EntityCoupleableRollingStock.java b/src/main/java/cam72cam/immersiverailroading/entity/EntityCoupleableRollingStock.java index b1de3064a..ca722030d 100644 --- a/src/main/java/cam72cam/immersiverailroading/entity/EntityCoupleableRollingStock.java +++ b/src/main/java/cam72cam/immersiverailroading/entity/EntityCoupleableRollingStock.java @@ -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(),