Skip to content

Commit

Permalink
add a nil check within the network check (#954)
Browse files Browse the repository at this point in the history
fixes #937
  • Loading branch information
rphillips committed Jun 26, 2017
1 parent 71e2bc4 commit a2d8bba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions check/network.lua
Expand Up @@ -87,8 +87,10 @@ function NetworkCheck:run(callback)
checkResult:setError('No such interface: ' .. self.interface_name)
else
local usage = interface:usage()
for key, value in pairs(usage) do
checkResult:addMetric(key, nil, 'gauge', value, units[key])
if usage then
for key, value in pairs(usage) do
checkResult:addMetric(key, nil, 'gauge', value, units[key])
end
end
end
Expand Down

0 comments on commit a2d8bba

Please sign in to comment.