From 05118a7d565b0123bdb80653a68ffa17c50e87e3 Mon Sep 17 00:00:00 2001 From: Quentin Perez Date: Thu, 5 Nov 2015 17:48:16 +0100 Subject: [PATCH] Fix nil dereference --- conn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conn.go b/conn.go index d68d997e..a4f53940 100644 --- a/conn.go +++ b/conn.go @@ -569,7 +569,7 @@ type transport interface { } var ( - transports map[string]func(string) (transport, error) = make(map[string]func(string) (transport, error)) + transports = make(map[string]func(string) (transport, error)) ) func getTransport(address string) (transport, error) { @@ -586,6 +586,7 @@ func getTransport(address string) (transport, error) { f := transports[v[:i]] if f == nil { err = errors.New("dbus: invalid bus address (invalid or unsupported transport)") + continue } t, err = f(v[i+1:]) if err == nil {