fix: add missing nil check in store.GetStore (#9354)
* fix: add missing nil check in store.GetStore * check nil in rootmulti as well
This commit is contained in:
@@ -492,7 +492,11 @@ func (rs *Store) GetStore(key types.StoreKey) types.Store {
|
||||
// NOTE: The returned KVStore may be wrapped in an inter-block cache if it is
|
||||
// set on the root store.
|
||||
func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore {
|
||||
store := rs.stores[key].(types.KVStore)
|
||||
s := rs.stores[key]
|
||||
if s == nil {
|
||||
panic(fmt.Sprintf("store does not exist for key: %s", key.Name()))
|
||||
}
|
||||
store := s.(types.KVStore)
|
||||
|
||||
if rs.TracingEnabled() {
|
||||
store = tracekv.NewStore(store, rs.traceWriter, rs.traceContext)
|
||||
|
||||
Reference in New Issue
Block a user