Fix validate that string is not empty before strconv.ParseFloat (#59)

Thanks. I could have sworn I went through already and done this at one point in time, but I guess not.
This commit is contained in:
Jesus Rafael Carrillo
2019-12-02 19:01:36 -08:00
committed by Steve Brunton
parent 5cccba9e17
commit 9ceb56fdbf
8 changed files with 30 additions and 10 deletions

View File

@@ -78,6 +78,9 @@ func (c *wlanSTACollector) collectForStat(re *proto.Sentence, ctx *collectorCont
}
func (c *wlanSTACollector) collectMetricForProperty(property, iface, mac string, re *proto.Sentence, ctx *collectorContext) {
if re.Map[property] == "" {
return
}
v, err := strconv.ParseFloat(re.Map[property], 64)
if err != nil {
log.WithFields(log.Fields{