Merge pull request #1446 from jkroepke/fix-windows2012

This commit is contained in:
Jan-Otto Kröpke
2024-04-21 08:46:44 +02:00
committed by GitHub

View File

@@ -3,6 +3,7 @@
package os package os
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"strings" "strings"
@@ -224,7 +225,9 @@ func (c *collector) collect(ctx *types.ScrapeContext, ch chan<- prometheus.Metri
} }
revision, _, err := ntKey.GetIntegerValue("UBR") revision, _, err := ntKey.GetIntegerValue("UBR")
if err != nil { if errors.Is(err, registry.ErrNotExist) {
revision = 0
} else if err != nil {
return nil, err return nil, err
} }