Skip to content

Commit

Permalink
Fix error handling in trie/node.go (#2159)
Browse files Browse the repository at this point in the history
chore: Fix error handling in trie/node.go
  • Loading branch information
AnkushinDaniil authored Sep 18, 2024
1 parent 494f9cc commit 793edae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/trie/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ func (n *Node) WriteTo(buf *bytes.Buffer) (int64, error) {
if n.Left != nil {
wrote, errInner := n.Left.WriteTo(buf)
totalBytes += wrote
if err != nil {
if errInner != nil {
return totalBytes, errInner
}
wrote, errInner = n.Right.WriteTo(buf) // n.Right is non-nil by design
totalBytes += wrote
if err != nil {
if errInner != nil {
return totalBytes, errInner
}
}
Expand Down

0 comments on commit 793edae

Please sign in to comment.