diff --git a/pkg/query/flamegraph_table.go b/pkg/query/flamegraph_table.go index 2c687742c7e..1e19cc14353 100644 --- a/pkg/query/flamegraph_table.go +++ b/pkg/query/flamegraph_table.go @@ -279,6 +279,9 @@ func (c *tableConverter) AddProfileLocation(l *profile.Location) uint32 { lines := make([]*metastorev1alpha1.Line, 0, len(l.Lines)) for _, line := range l.Lines { + if line.Function == nil { + continue + } lines = append(lines, &metastorev1alpha1.Line{ Line: line.Line, FunctionIndex: c.AddFunction(line.Function), diff --git a/pkg/query/top.go b/pkg/query/top.go index f8c829f1abe..a44889d1ddb 100644 --- a/pkg/query/top.go +++ b/pkg/query/top.go @@ -52,7 +52,7 @@ func GenerateTopTable(ctx context.Context, p parcaprofile.OldProfile) (*pb.Top, }, }, } - if len(location.Lines) > 0 { + if len(location.Lines) > 0 && location.Lines[0].Function != nil { // TODO: Return or merge multiple lines for samples node.Meta.Function = location.Lines[0].Function node.Meta.Line = &metastorev1alpha1.Line{