From f11259d75d53a9e7ebeec03b163bd533f5cc90df Mon Sep 17 00:00:00 2001 From: "Matt, Park" <45252226+mattverse@users.noreply.github.com> Date: Fri, 1 Dec 2023 12:54:26 +0900 Subject: [PATCH] fix: Add Err handling for ABCI Query Route for wasm binded query (#6886) * Add err handle * ADd changelog --- CHANGELOG.md | 1 + wasmbinding/query_plugin.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3be2b34670..cc43ce91609 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#6758](https://github.com/osmosis-labs/osmosis/pull/6758) Add codec for MsgUndelegateFromRebalancedValidatorSet * [#6836](https://github.com/osmosis-labs/osmosis/pull/6836) Add DenomsMetadata to stargate whitelist and fixs the DenomMetadata response type * [#6814](https://github.com/osmosis-labs/osmosis/pull/6814) Add EstimateTradeBasedOnPriceImpact to stargate whitelist +* [#6886](https://github.com/osmosis-labs/osmosis/pull/6886) Add Err handling for ABCI Query Route for wasm binded query * [#6859](https://github.com/osmosis-labs/osmosis/pull/6859) Add hooks to core CL operations (position creation/withdrawal and swaps) * [#6932](https://github.com/osmosis-labs/osmosis/pull/6932) Allow protorev module to receive tokens * [#6937](https://github.com/osmosis-labs/osmosis/pull/6937) Update wasmd to v0.45.0 and wasmvm to v1.5.0 diff --git a/wasmbinding/query_plugin.go b/wasmbinding/query_plugin.go index 45056da2833..2cf392ff512 100644 --- a/wasmbinding/query_plugin.go +++ b/wasmbinding/query_plugin.go @@ -35,6 +35,10 @@ func StargateQuerier(queryRouter baseapp.GRPCQueryRouter, cdc codec.Codec) func( return nil, err } + if res.Value == nil { + return nil, fmt.Errorf("Res returned from abci query route is nil") + } + bz, err := ConvertProtoToJSONMarshal(protoResponseType, res.Value, cdc) if err != nil { return nil, err