Skip to content

Commit f8dcd4d

Browse files
committed
Modbus Proxy: fix panic
1 parent c93955c commit f8dcd4d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/setup.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,11 @@ func configureModbusProxy(conf *[]globalconfig.ModbusProxy) error {
990990
}
991991
}
992992

993+
// prevent panic
994+
if conf == nil {
995+
return nil
996+
}
997+
993998
for _, cfg := range *conf {
994999
var mode modbus.ReadOnlyMode
9951000
mode, err := modbus.ReadOnlyModeString(cfg.ReadOnly)

0 commit comments

Comments
 (0)