mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-16 15:26:40 +00:00
fix(system.GetInfo) check if context is nil
This commit is contained in:
@@ -49,11 +49,13 @@ func GetInfo(ctx context.Context) *Info {
|
||||
gio.Hostname, _ = os.Hostname()
|
||||
gio.WiretrusteeVersion = WiretrusteeVersion()
|
||||
|
||||
metadata, ok := metadata.FromIncomingContext(ctx)
|
||||
if ctx != nil {
|
||||
metadata, ok := metadata.FromIncomingContext(ctx)
|
||||
|
||||
if ok {
|
||||
gio.Caller = metadata["caller"][0]
|
||||
gio.CallerVersion = metadata["callerVersion"][0]
|
||||
if ok {
|
||||
gio.Caller = metadata["caller"][0]
|
||||
gio.CallerVersion = metadata["callerVersion"][0]
|
||||
}
|
||||
}
|
||||
|
||||
return gio
|
||||
|
||||
Reference in New Issue
Block a user