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:
committed by
Steve Brunton
parent
5cccba9e17
commit
9ceb56fdbf
@@ -93,7 +93,9 @@ func (c *wlanIFCollector) collectForInterface(iface string, ctx *collectorContex
|
||||
func (c *wlanIFCollector) collectMetricForProperty(property, iface string, re *proto.Sentence, ctx *collectorContext) {
|
||||
desc := c.descriptions[property]
|
||||
channel := re.Map["channel"]
|
||||
|
||||
if re.Map[property] == "" {
|
||||
return
|
||||
}
|
||||
v, err := strconv.ParseFloat(re.Map[property], 64)
|
||||
if err != nil {
|
||||
log.WithFields(log.Fields{
|
||||
|
||||
Reference in New Issue
Block a user