Skip to content

Commit

Permalink
process transaction nil error
Browse files Browse the repository at this point in the history
  • Loading branch information
yeabow committed May 25, 2021
1 parent b4463f9 commit 05f83b4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions message/encoder_readable.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package message

import (
"bytes"
"errors"
"fmt"
)

Expand Down Expand Up @@ -148,6 +149,11 @@ func (e *ReadableEncoder) EncodeHeader(buf *bytes.Buffer, header *Header) (err e
}

func (e *ReadableEncoder) EncodeTransaction(buf *bytes.Buffer, trans *Transaction) (err error) {
if trans == nil {
err = errors.New("trans is null")
return
}

children := trans.GetChildren()
if len(children) == 0 {
return e.encodeLine(buf, trans, 'A', POLICY_WITH_DURATION)
Expand Down

0 comments on commit 05f83b4

Please sign in to comment.