diff --git a/Service/Execute/Step/CancelState.cs b/Service/Execute/Step/CancelState.cs index 04b389e..a8e8ff1 100644 --- a/Service/Execute/Step/CancelState.cs +++ b/Service/Execute/Step/CancelState.cs @@ -25,7 +25,7 @@ public class CancelState : IState { _log.Info($"'goto cancel"); machine.CancelFlag = false; - if (machine.SwapOrderBatteryInfo.swapAmtOrder != null) + if (machine.SwapOrderBatteryInfo!=null && machine.SwapOrderBatteryInfo.swapAmtOrder != null) { machine.SwapOrderBatteryInfo.swapAmtOrder.Status = (byte)InfoEnum.AmtOrderStatus.SwapFail; _swapAmtOrderRepository.Update(machine.SwapOrderBatteryInfo.swapAmtOrder);