Skip to content

Commit

Permalink
fix(plc4go/tcp): fix tcp String() when local address is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Apr 17, 2023
1 parent 1db022e commit 92039d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plc4go/spi/transports/tcp/Transport.go
Expand Up @@ -173,5 +173,9 @@ func (m *TransportInstance) GetReader() *bufio.Reader {
}

func (m *TransportInstance) String() string {
return fmt.Sprintf("tcp:%s->%s", m.LocalAddress, m.RemoteAddress)
localAddress := ""
if m.LocalAddress != nil {
localAddress = m.LocalAddress.String() + "->"
}
return fmt.Sprintf("tcp:%s%s", localAddress, m.RemoteAddress)
}

0 comments on commit 92039d0

Please sign in to comment.