Fix Windows name on WMI error (#1426)

Before, netbird would exit and prevent the agent from starting if getting the system name using WMI was an issue.

This change returns a default value in this case
This commit is contained in:
Maycon Santos 2024-01-01 21:28:42 +01:00 committed by GitHub
parent c1caec3fcb
commit 86908eee58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,8 @@ func getOSNameAndVersion() (string, string) {
query := wmi.CreateQuery(&dst, "") query := wmi.CreateQuery(&dst, "")
err := wmi.Query(query, &dst) err := wmi.Query(query, &dst)
if err != nil { if err != nil {
log.Fatal(err) log.Error(err)
return "Windows", getBuildVersion()
} }
if len(dst) == 0 { if len(dst) == 0 {