aboutsummaryrefslogtreecommitdiff
path: root/src/internal/profile/encode.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/profile/encode.go')
-rw-r--r--src/internal/profile/encode.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/internal/profile/encode.go b/src/internal/profile/encode.go
index 77d77f1dfb..72d6fe2fa7 100644
--- a/src/internal/profile/encode.go
+++ b/src/internal/profile/encode.go
@@ -207,6 +207,9 @@ var profileDecoder = []decoder{
// suffix X) and populates the corresponding exported fields.
// The unexported fields are cleared up to facilitate testing.
func (p *Profile) postDecode() error {
+ if p.Empty() {
+ return nil
+ }
var err error
mappings := make(map[uint64]*Mapping)
@@ -291,7 +294,7 @@ func (p *Profile) postDecode() error {
p.commentX = nil
p.DefaultSampleType, err = getString(p.stringTable, &p.defaultSampleTypeX, err)
p.stringTable = nil
- return nil
+ return err
}
func (p *ValueType) decoder() []decoder {