Skip to content

Instantly share code, notes, and snippets.

@whyrusleeping
Created June 20, 2015 04:13
Show Gist options
  • Save whyrusleeping/8b0214e54561ab8be674 to your computer and use it in GitHub Desktop.
Save whyrusleeping/8b0214e54561ab8be674 to your computer and use it in GitHub Desktop.
diff --git a/merkledag/coding.go b/merkledag/coding.go
index 6e108c2..1a29a35 100644
--- a/merkledag/coding.go
+++ b/merkledag/coding.go
@@ -70,7 +70,9 @@ func (n *Node) getPBNode() *pb.PBNode {
pbn.Links[i].Hash = []byte(l.Hash)
}
- pbn.Data = n.Data
+ if len(n.Data) > 0 {
+ pbn.Data = n.Data
+ }
return pbn
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment