Skip to content

Commit

Permalink
fix panic
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer-zq committed Aug 14, 2024
1 parent 3cea3d7 commit 5d20cda
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/evm/types/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
package types

import (
errorsmod "cosmossdk.io/errors"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
errortypes "github.com/cosmos/cosmos-sdk/types/errors"
)

// UnpackInterfaces implements UnpackInterfacesMesssage.UnpackInterfaces
Expand All @@ -26,9 +28,13 @@ func (m QueryTraceTxRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) e
return err
}
}
if m.Msg == nil {
return errorsmod.Wrapf(errortypes.ErrInvalidRequest, "msg cannot be nil")
}
return m.Msg.UnpackInterfaces(unpacker)
}

// UnpackInterfaces implements UnpackInterfacesMesssage.UnpackInterfaces
func (m QueryTraceBlockRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error {
for _, msg := range m.Txs {
if err := msg.UnpackInterfaces(unpacker); err != nil {
Expand Down

0 comments on commit 5d20cda

Please sign in to comment.