From a410dfe246f3741cbbbc132e7e14ad6b98c5cd4d Mon Sep 17 00:00:00 2001 From: Kay-Zee Date: Mon, 25 Jan 2021 17:30:52 -0800 Subject: [PATCH] Index out of bounds issues --- engine/access/rpc/backend/backend_events.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/access/rpc/backend/backend_events.go b/engine/access/rpc/backend/backend_events.go index d3827d9128d..fb56db718e4 100644 --- a/engine/access/rpc/backend/backend_events.go +++ b/engine/access/rpc/backend/backend_events.go @@ -103,6 +103,10 @@ func (b *backendEvents) getBlockEventsFromExecutionNode( BlockIds: convert.IdentifiersToMessages(blockIDs), } + if len(blockIDs) == 0 { + return []flow.BlockEvents{}, nil + } + // choose the last block ID to find the list of execution nodes lastBlockID := blockIDs[len(blockIDs)-1]