Skip to content

Commit

Permalink
Merge pull request #1446 from jkroepke/fix-windows2012
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke committed Apr 21, 2024
2 parents 21a64b1 + d503ae0 commit 658fbd9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/collector/os/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package os

import (
"errors"
"fmt"
"os"
"strings"
Expand Down Expand Up @@ -224,7 +225,9 @@ func (c *collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
}

revision, _, err := ntKey.GetIntegerValue("UBR")
if err != nil {
if errors.Is(err, registry.ErrNotExist) {
revision = 0
} else if err != nil {
return nil, err
}

Expand Down

0 comments on commit 658fbd9

Please sign in to comment.