Skip to content

Commit

Permalink
Fix panic in mongo input (#2848)
Browse files Browse the repository at this point in the history
(cherry picked from commit e7f9db2)
  • Loading branch information
snardone authored and danielnelson committed May 30, 2017
1 parent 7ca902f commit 7f67bf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/inputs/mongodb/mongostat.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func NewStatLine(oldMongo, newMongo MongoStatus, key string, all bool, sampleSec
// BEGIN code modification
if newStat.Repl.IsMaster.(bool) {
returnVal.NodeType = "PRI"
} else if newStat.Repl.Secondary.(bool) {
} else if newStat.Repl.Secondary != nil && newStat.Repl.Secondary.(bool) {
returnVal.NodeType = "SEC"
} else if newStat.Repl.ArbiterOnly != nil && newStat.Repl.ArbiterOnly.(bool) {
returnVal.NodeType = "ARB"
Expand Down

0 comments on commit 7f67bf5

Please sign in to comment.