Skip to content

Commit

Permalink
Merge pull request #480 from jnewmano/nsqadmin_nill
Browse files Browse the repository at this point in the history
check for case when the channel name does not exist in allChannelStats
  • Loading branch information
mreiferson committed Oct 22, 2014
2 parents 63596a8 + 780ef31 commit f2dd711
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nsqadmin/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ func (s *httpServer) channelHandler(w http.ResponseWriter, req *http.Request, to

producers := s.getProducers(topicName)
_, allChannelStats, _ := lookupd.GetNSQDStats(producers, topicName)
channelStats := allChannelStats[channelName]
channelStats, ok := allChannelStats[channelName]

if !ok {
s.ctx.nsqadmin.logf("ERROR: channel stats do not exist")
http.Error(w, "INVALID_REQUEST", 500)
return
}

hasE2eLatency := channelStats.E2eProcessingLatency != nil &&
len(channelStats.E2eProcessingLatency.Percentiles) > 0
Expand Down

0 comments on commit f2dd711

Please sign in to comment.