Skip to content

Commit

Permalink
fix: unsafeStrToSlice panic due to empty string (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
linthan committed Feb 3, 2022
1 parent fb7256a commit 189f775
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/storage/tree/tree_profile.go
Expand Up @@ -125,7 +125,7 @@ func (r *ProfileReader) readTrees(x *Profile, c labelsCache, f Finder) {
// Therefore iteration goes in reverse order.
for j := len(loc.Line) - 1; j >= 0; j-- {
fn, ok := f.FindFunction(loc.Line[j].FunctionId)
if !ok {
if !ok || x.StringTable[fn.Name] == "" {
continue
}
stack = append(stack, unsafeStrToSlice(x.StringTable[fn.Name]))
Expand Down

0 comments on commit 189f775

Please sign in to comment.