Skip to content

Commit

Permalink
event.Data can be nil for the payload attr event
Browse files Browse the repository at this point in the history
  • Loading branch information
kasey committed Oct 4, 2024
1 parent 8fa168e commit 81504c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions beacon-chain/rpc/eth/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,16 @@ func topicForEvent(event *feed.Event) string {
}

func (s *Server) lazyReaderForEvent(ctx context.Context, event *feed.Event, topics *topicRequest) (lazyReader, error) {
if event == nil || event.Data == nil {
return nil, errors.New("event or event data is nil")
}
eventName := topicForEvent(event)
if !topics.requested(eventName) {
return nil, errNotRequested
}
if eventName == PayloadAttributesTopic {
return s.currentPayloadAttributes(ctx)
}
if event == nil || event.Data == nil {
return nil, errors.New("event or event data is nil")
}
switch v := event.Data.(type) {
case *ethpb.EventHead:
// The head event is a special case because, if the client requested the payload attributes topic,
Expand Down

0 comments on commit 81504c8

Please sign in to comment.