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

This commit is contained in:
Marko 2023-10-23 15:33:48 +02:00 committed by GitHub
parent 442c3c5e4b
commit 19eaac3ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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