Skip to content

Commit

Permalink
check for nil pointers before dereferencing
Browse files Browse the repository at this point in the history
  • Loading branch information
tux21b committed Aug 21, 2013
1 parent b3429c1 commit e94363c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions topology.go
Expand Up @@ -58,6 +58,9 @@ func (r *RoundRobin) Pick(qry *Query) *Conn {
node = r.pool[pos%uint32(len(r.pool))]
}
r.mu.RUnlock()
if node == nil {
return nil
}
return node.Pick(qry)
}

Expand Down

0 comments on commit e94363c

Please sign in to comment.