Compare with nil before invoking IsNil() on an interface (#14431)

* Compare with nil before invoking `IsNil()` on an interface

* changelog

* review
This commit is contained in:
Radosław Kapka
2024-09-06 15:39:33 -04:00
committed by GitHub
parent eec3b0b7fe
commit 62b8e63a0a
10 changed files with 15 additions and 17 deletions

View File

@@ -276,7 +276,7 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e
}
func (b *SignedBeaconBlock) Unblind(e interfaces.ExecutionData) error {
if e.IsNil() {
if e == nil || e.IsNil() {
return errors.New("cannot unblind with nil execution data")
}
if !b.IsBlinded() {