From c349fc8a4ef5673d0cf0154ec06f5a05facb59ec Mon Sep 17 00:00:00 2001 From: shatoboar Date: Fri, 20 May 2022 17:12:29 +0200 Subject: [PATCH] fix(system.GetInfo) check if context is nil --- client/system/info_linux.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/client/system/info_linux.go b/client/system/info_linux.go index 813ea20a0..aea98c3b8 100644 --- a/client/system/info_linux.go +++ b/client/system/info_linux.go @@ -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