From b7eccc6b51e2e77ac8adfbe33d4764f95d363196 Mon Sep 17 00:00:00 2001 From: Christian Lohr Date: Wed, 22 Jan 2025 15:32:01 +0100 Subject: [PATCH] fix: prevent panic for param retrieval --- x/paloma/keeper/params.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/paloma/keeper/params.go b/x/paloma/keeper/params.go index a3465780..1348873e 100644 --- a/x/paloma/keeper/params.go +++ b/x/paloma/keeper/params.go @@ -9,6 +9,12 @@ import ( // GetParams get all parameters as types.Params func (k Keeper) GetParams(ctx context.Context) (params types.Params) { + defer func() { + if r := recover(); r != nil { + params = types.DefaultParams() + } + }() + sdkCtx := sdk.UnwrapSDKContext(ctx) k.paramstore.GetParamSet(sdkCtx, ¶ms) return params