From 8f0ae9db3f09f4febec4d73f81e5ab2f2dac09ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CDongLieu=E2=80=9D?= Date: Mon, 2 Dec 2024 17:07:42 +0700 Subject: [PATCH] update Init: check map --- x/accounts/keeper.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/accounts/keeper.go b/x/accounts/keeper.go index 939c0e1c7040..19825a636740 100644 --- a/x/accounts/keeper.go +++ b/x/accounts/keeper.go @@ -173,7 +173,11 @@ func (k Keeper) initFromMsg(ctx context.Context, initMsg *v1.MsgInit) (transacti return nil, nil, err } - schema := v1.MakeAccountSchema(k.accounts[initMsg.AccountType]) + impl, ok := k.accounts[initMsg.AccountType] + if !ok { + return nil, nil, err + } + schema := v1.MakeAccountSchema(impl) // decode message bytes into the concrete boxed message type msg, err := implementation.EncodeMsgJSONToProto(schema.InitSchema.Request, initMsg.JsonMessage)