Skip to content

Commit

Permalink
Merge pull request #42 from QuentinPerez/patch1
Browse files Browse the repository at this point in the history
Fix nil dereference
  • Loading branch information
jonboulle committed Nov 5, 2015
2 parents 9bb9dbf + 05118a7 commit c7fdd8b
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 c7fdd8b

Please sign in to comment.