client/web: fix 500 error after logout

Calling DebugPacketFilterRules fails when the node is not logged
in, which was causing 500 errors on the node data endpoint after
logging the node out.

Updates #10261

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
This commit is contained in:
Sonia Appasamy 2023-12-08 14:58:48 -05:00 committed by Sonia Appasamy
parent 86aa0485a6
commit 7c172df791

View File

@ -601,11 +601,7 @@ func (s *Server) serveGetNodeData(w http.ResponseWriter, r *http.Request) {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
filterRules, err := s.lc.DebugPacketFilterRules(r.Context())
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
filterRules, _ := s.lc.DebugPacketFilterRules(r.Context())
data := &nodeData{
ID: st.Self.ID,
Status: st.BackendState,