Merge pull request #7 from ginabythebay/master

Avoid nil dereference when LastMeasure is not available
This commit is contained in:
Nicolas Leclercq 2020-10-09 09:33:08 +02:00 committed by GitHub
commit a8620474d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,10 @@ func main() {
fmt.Printf("\tModule : %s\n", module.ModuleName)
{
if module.DashboardData.LastMeasure == nil {
fmt.Printf("\t\tSkipping %s, no measurement data available.\n", module.ModuleName)
continue
}
ts, data := module.Info()
for dataName, value := range data {
fmt.Printf("\t\t%s : %v (updated %ds ago)\n", dataName, value, ct-ts)