diff --git a/protobuf/decode.go b/protobuf/decode.go index 1b9677b..bf6e9c5 100644 --- a/protobuf/decode.go +++ b/protobuf/decode.go @@ -204,12 +204,14 @@ func (msg *Substate_TxMessage) decode(lookup dbGetCode) (*substate.Message, erro var blobHashes []types.Hash = nil switch txType { case Substate_TxMessage_TXTYPE_BLOB: - if msg.GetBlobHashes() != nil { - blobHashes = make([]types.Hash, len(msg.GetBlobHashes())) - for i, hash := range msg.GetBlobHashes() { - blobHashes[i] = types.BytesToHash(hash) - } - } + msgBlobHashes := msg.GetBlobHashes() + if msgBlobHashes == nil { + break + } + blobHashes = make([]types.Hash, len(msgBlobHashes)) + for i, hash := range msgBlobHashes { + blobHashes[i] = types.BytesToHash(hash) + } } return &substate.Message{