Skip to content

Commit

Permalink
fix: prevent panic for param retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
byte-bandit committed Jan 22, 2025
1 parent 3d8ed87 commit b7eccc6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions x/paloma/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, &params)
return params
Expand Down

0 comments on commit b7eccc6

Please sign in to comment.