diff --git a/src/src/main/java/com/my/graphiteDigesterBg/diframe/connection/DiConModbusRTUOverTCP.java b/src/src/main/java/com/my/graphiteDigesterBg/diframe/connection/DiConModbusRTUOverTCP.java index 98ee6e8..37f9d92 100644 --- a/src/src/main/java/com/my/graphiteDigesterBg/diframe/connection/DiConModbusRTUOverTCP.java +++ b/src/src/main/java/com/my/graphiteDigesterBg/diframe/connection/DiConModbusRTUOverTCP.java @@ -71,6 +71,9 @@ public class DiConModbusRTUOverTCP { cmd[4] = 0x00; // value high cmd[5] = 0x01; // value low var response = this.call(cmd); + if (response.isEmpty()) { + throw new RuntimeException("Modbus RTU over TCP: no response"); + } return response.get(3) << 8 | response.get(4); }