From d653d88ab01df0e85470e49a70167b24c170ead9 Mon Sep 17 00:00:00 2001 From: tgbv <31542280+tgbv@users.noreply.github.com> Date: Sat, 30 Sep 2023 17:54:16 +0300 Subject: [PATCH 1/3] fix: invalid mem addr or nil pointer deref --- gui/tunnels.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gui/tunnels.go b/gui/tunnels.go index e3284de..0d51f16 100755 --- a/gui/tunnels.go +++ b/gui/tunnels.go @@ -413,6 +413,10 @@ func (t *Tunnels) Create() error { btnDelTunnel.Connect("clicked", func() { err := func() error { row := tl.GetSelectedRow() + if row == nil { + return fmt.Errorf("No row not selected.") + } + name, err := row.GetName() if err != nil { return err From 0a0b34ff530ee82e66ad0d1366274d89e8ee628a Mon Sep 17 00:00:00 2001 From: tgbv <31542280+tgbv@users.noreply.github.com> Date: Sat, 30 Sep 2023 17:57:34 +0300 Subject: [PATCH 2/3] chore: fixed spelling mistake --- gui/tunnels.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/tunnels.go b/gui/tunnels.go index 0d51f16..5e374c8 100755 --- a/gui/tunnels.go +++ b/gui/tunnels.go @@ -414,7 +414,7 @@ func (t *Tunnels) Create() error { err := func() error { row := tl.GetSelectedRow() if row == nil { - return fmt.Errorf("No row not selected.") + return fmt.Errorf("No row selected.") } name, err := row.GetName() From a541ac2223e9d4d429eb0d41b60105e5548e98ce Mon Sep 17 00:00:00 2001 From: tgbv <31542280+tgbv@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:01:44 +0300 Subject: [PATCH 3/3] chore: using errors pkg instead of fmt --- gui/tunnels.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/tunnels.go b/gui/tunnels.go index 5e374c8..20299f1 100755 --- a/gui/tunnels.go +++ b/gui/tunnels.go @@ -414,7 +414,7 @@ func (t *Tunnels) Create() error { err := func() error { row := tl.GetSelectedRow() if row == nil { - return fmt.Errorf("No row selected.") + return errors.New("No row selected.") } name, err := row.GetName()