From bd617d1297daf708b3383842887affc4125127fa Mon Sep 17 00:00:00 2001 From: Joshua Blum Date: Mon, 28 Sep 2020 11:40:11 -0400 Subject: [PATCH] check nil user from status --- go/client/kvstore_api_handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/client/kvstore_api_handler.go b/go/client/kvstore_api_handler.go index cd304add0355..66b7e9e347db 100644 --- a/go/client/kvstore_api_handler.go +++ b/go/client/kvstore_api_handler.go @@ -62,7 +62,10 @@ func (t *kvStoreAPIHandler) handleV1(ctx context.Context, c Call, w io.Writer) e status, err := config.GetCurrentStatus(context.Background(), 0) if err != nil { return err + } else if !status.LoggedIn || status.User == nil { + return errors.New("not logged in") } + username := status.User.Username t.selfTeam = fmt.Sprintf("%s,%s", username, username)