Skip to content

Commit

Permalink
Do not panic when getting params.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim committed Jun 1, 2023
1 parent adb29be commit acbc432
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/core/03-connection/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func (k Keeper) addConnectionToClient(ctx sdk.Context, clientID, connectionID st
func (k Keeper) GetParams(ctx sdk.Context) types.Params {
store := ctx.KVStore(k.storeKey)
bz := store.Get([]byte(types.ParamsKey))
if bz == nil { // only panic on unset params and not on empty params
panic("controller params are not set in store")
if len(bz) == 0 {
return types.Params{}
}

var params types.Params
Expand Down

0 comments on commit acbc432

Please sign in to comment.