Skip to content

Commit 84c165f

Browse files
committed
Fix the nested if else
1 parent cc2cf81 commit 84c165f

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

reporter/parca_reporter.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,15 +1443,10 @@ func (r *ParcaReporter) buildStacktraceRecord(ctx context.Context, stacktraceIDs
14431443
if filePath == "" {
14441444
filePath = "UNKNOWN"
14451445
}
1446-
if frame.Mapping.Valid() {
1446+
if frame.Mapping.Valid() && frame.Mapping.Value().File.Value().GnuBuildID != "" {
14471447
file := frame.Mapping.Value().File.Value()
1448-
if file.GnuBuildID != "" {
1449-
w.MappingFile.AppendString(file.FileName.String())
1450-
w.MappingBuildID.AppendString(file.GnuBuildID)
1451-
} else {
1452-
w.MappingFile.AppendString(frameKind.String())
1453-
w.MappingBuildID.AppendNull()
1454-
}
1448+
w.MappingFile.AppendString(file.FileName.String())
1449+
w.MappingBuildID.AppendString(file.GnuBuildID)
14551450
} else {
14561451
w.MappingFile.AppendString(frameKind.String())
14571452
w.MappingBuildID.AppendNull()

0 commit comments

Comments
 (0)