mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-22 22:59:09 +02: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.Hostname, _ = os.Hostname()
|
||||||
gio.WiretrusteeVersion = WiretrusteeVersion()
|
gio.WiretrusteeVersion = WiretrusteeVersion()
|
||||||
|
|
||||||
metadata, ok := metadata.FromIncomingContext(ctx)
|
if ctx != nil {
|
||||||
|
metadata, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
|
||||||
if ok {
|
if ok {
|
||||||
gio.Caller = metadata["caller"][0]
|
gio.Caller = metadata["caller"][0]
|
||||||
gio.CallerVersion = metadata["callerVersion"][0]
|
gio.CallerVersion = metadata["callerVersion"][0]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return gio
|
return gio
|
||||||
|
|||||||
Reference in New Issue
Block a user