fix(authz): check string is not empty (backport #18209) (#18217)

Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
mergify[bot] 2023-10-23 16:03:15 +00:00 committed by GitHub
parent 535567e231
commit aa72f10b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,8 @@
package authz
import (
context "context"
"context"
"errors"
sdk "github.com/cosmos/cosmos-sdk/types"
)
@ -27,5 +28,8 @@ func (a GenericAuthorization) Accept(ctx context.Context, msg sdk.Msg) (AcceptRe
// ValidateBasic implements Authorization.ValidateBasic.
func (a GenericAuthorization) ValidateBasic() error {
if a.Msg == "" {
return errors.New("msg type cannot be empty")
}
return nil
}