Skip to content

Commit

Permalink
Merge pull request samuel#75 from spenczar/flw_bugfix
Browse files Browse the repository at this point in the history
Fix nil pointer error in FLWSrvr
  • Loading branch information
samuel committed Aug 17, 2015
2 parents 01d8ae0 + f929e06 commit 177002e
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 177002e

Please sign in to comment.