From e434a72d36ea19a99bfa3b7486b1360183bb09c0 Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Wed, 8 May 2024 08:36:12 +0700 Subject: [PATCH 1/2] fix: Issue forwarding events for connections without name --- pkg/listen/listen.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/listen/listen.go b/pkg/listen/listen.go index bf8d8d0..25e527f 100644 --- a/pkg/listen/listen.go +++ b/pkg/listen/listen.go @@ -80,7 +80,11 @@ func Listen(URL *url.URL, source_alias string, connectionQuery string, flags Fla fmt.Println(ansi.Bold("Connections")) for _, connection := range connections { - fmt.Println(*connection.Name + " forwarding to " + *connection.Destination.CliPath) + connectionName := "" + if connection.Name != nil { + connectionName = *connection.Name + } + fmt.Println(connectionName + " forwarding to " + *connection.Destination.CliPath) } fmt.Println() From dea12613fa85ff315073b1f46a8d29412fdc4be8 Mon Sep 17 00:00:00 2001 From: Alex Luong Date: Wed, 8 May 2024 18:46:01 +0700 Subject: [PATCH 2/2] fix: Default to destination name when connection does not have a name --- pkg/listen/listen.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/listen/listen.go b/pkg/listen/listen.go index 25e527f..65c41f8 100644 --- a/pkg/listen/listen.go +++ b/pkg/listen/listen.go @@ -80,9 +80,11 @@ func Listen(URL *url.URL, source_alias string, connectionQuery string, flags Fla fmt.Println(ansi.Bold("Connections")) for _, connection := range connections { - connectionName := "" + var connectionName string if connection.Name != nil { connectionName = *connection.Name + } else { + connectionName = connection.Destination.Name } fmt.Println(connectionName + " forwarding to " + *connection.Destination.CliPath) }