Skip to content

Commit

Permalink
fix: 机器id获取不到时,不崩溃
Browse files Browse the repository at this point in the history
  • Loading branch information
iseki0 committed Nov 24, 2022
1 parent 86f50a8 commit 1c115b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions version/machine_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ package version

import (
"github.com/denisbrodbeck/machineid"
"github.com/murphysecurity/murphysec/utils/must"
)

func MachineId() string {
return must.A(machineid.ProtectedID("murphysec"))
s, e := machineid.ProtectedID("murphysec")
if e != nil {
return "<NoMachineID>"
}
return s
}

0 comments on commit 1c115b8

Please sign in to comment.