serving/xrefs: fix nil pointer exception for Documentation node without facts matching filters
Reviewers: #core_team, jrtom
Subscribers: #core_team
@@ -1397,7 +1397,7 @@ func d2d(d *srvpb.Document, patterns []*regexp.Regexp, nodes map[string]*cpb.Nod
continue
}
- n := nodeToInfo(patterns, node)
+ if n := nodeToInfo(patterns, node); n != nil {
nodes[node.Ticket] = n
if def := node.DefinitionLocation; def != nil {
n.Definition = def.Ticket
@@ -1406,6 +1406,7 @@ func d2d(d *srvpb.Document, patterns []*regexp.Regexp, nodes map[string]*cpb.Nod
}
}
}
+ }
return &xpb.DocumentationReply_Document{
Ticket: d.Ticket,
