Avoid nil case when fixing data

This commit is contained in:
chrislusf 2015-07-08 23:21:53 -07:00
parent 3476d31e50
commit a4d3f2da3d

View File

@ -120,7 +120,7 @@ func (n *Needle) Append(w io.Writer, version Version) (size uint32, err error) {
return
}
}
if n.HasTtl() {
if n.HasTtl() && n.Ttl != nil {
n.Ttl.ToBytes(header[0:TtlBytesLength])
if _, err = w.Write(header[0:TtlBytesLength]); err != nil {
return