mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-24 17:13:30 +01:00
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:
parent
c1caec3fcb
commit
86908eee58
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user