Skip to content

Commit

Permalink
Fix nil pointer error in FLWSrvr
Browse files Browse the repository at this point in the history
  • Loading branch information
spenczar committed Aug 13, 2015
1 parent 5bb5cfc commit f929e06
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zk/flw.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ func FLWSrvr(servers []string, timeout time.Duration) ([]*ServerStats, bool) {
continue
}

match := re.FindAllStringSubmatch(string(response), -1)[0][1:]
matches := re.FindAllStringSubmatch(string(response), -1)

if match == nil {
if matches == nil {
err := fmt.Errorf("unable to parse fields from zookeeper response (no regex matches)")
ss[i] = &ServerStats{Error: err}
imOk = false
continue
}

match := matches[0][1:]

// determine current server
var srvrMode Mode
switch match[10] {
Expand Down

0 comments on commit f929e06

Please sign in to comment.