Skip to content

Commit

Permalink
Fix nil dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Perez committed Nov 5, 2015
1 parent 9bb9dbf commit 05118a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 {
Expand Down

0 comments on commit 05118a7

Please sign in to comment.