aboutsummaryrefslogtreecommitdiffstats
path: root/common/bytes.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/bytes.go')
-rw-r--r--common/bytes.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/bytes.go b/common/bytes.go
index c445968f2..66577bbfd 100644
--- a/common/bytes.go
+++ b/common/bytes.go
@@ -47,6 +47,9 @@ func FromHex(s string) []byte {
//
// Returns an exact copy of the provided bytes
func CopyBytes(b []byte) (copiedBytes []byte) {
+ if b == nil {
+ return nil
+ }
copiedBytes = make([]byte, len(b))
copy(copiedBytes, b)