aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorAaron Buchwald <[email protected]>2020-09-17 09:20:36 -0400
committerAaron Buchwald <[email protected]>2020-09-17 09:20:36 -0400
commit6b4efa7ff5537a7cdb1d73b18dd75f56bdadc032 (patch)
tree85da01f5b75788e257d3c355917a4b3a8ad8603b /core
parent8123ec9caeb1917519c1f8f67f386df142578728 (diff)
Fix potential nil pointer dereference
Diffstat (limited to 'core')
-rw-r--r--core/types/block.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/types/block.go b/core/types/block.go
index 99d6cc8..0a93601 100644
--- a/core/types/block.go
+++ b/core/types/block.go
@@ -330,6 +330,9 @@ func (b *Block) SetExtraData(data []byte) {
}
func (b *Block) ExtraData() []byte {
+ if b.extdata == nil {
+ return nil
+ }
return *b.extdata
}