diff --git a/client/tailscale/apitype/apitype.go b/client/tailscale/apitype/apitype.go index c3dbd5a78..b63abf69c 100644 --- a/client/tailscale/apitype/apitype.go +++ b/client/tailscale/apitype/apitype.go @@ -10,6 +10,7 @@ import "tailscale.com/tailcfg" const LocalAPIHost = "local-tailscaled.sock" // WhoIsResponse is the JSON type returned by tailscaled debug server's /whois?ip=$IP handler. +// In successful whois responses, Node and UserProfile are never nil. type WhoIsResponse struct { Node *tailcfg.Node UserProfile *tailcfg.UserProfile diff --git a/ipn/localapi/localapi.go b/ipn/localapi/localapi.go index e2fe3b6bc..36b8cbf16 100644 --- a/ipn/localapi/localapi.go +++ b/ipn/localapi/localapi.go @@ -427,8 +427,8 @@ func (h *Handler) serveWhoIs(w http.ResponseWriter, r *http.Request) { return } res := &apitype.WhoIsResponse{ - Node: n, - UserProfile: &u, + Node: n, // always non-nil per WhoIsResponse contract + UserProfile: &u, // always non-nil per WhoIsResponse contract CapMap: b.PeerCaps(ipp.Addr()), } j, err := json.MarshalIndent(res, "", "\t")