fix: x/group/internal/orm: return iterator close errors (#13714)

Instead of nakedly always returning nil, instead return
the actual close errors.

Fixes https://github.com/cosmos/cosmos-sdk/security/code-scanning/6295
Fixes https://github.com/cosmos/cosmos-sdk/security/code-scanning/6296
This commit is contained in:
Emmanuel T Odeke 2022-11-01 01:24:41 -07:00 committed by GitHub
parent 0d8787c3bd
commit cafa6b5125
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -256,8 +256,7 @@ func (i indexIterator) LoadNext(dest codec.ProtoMarshaler) (RowID, error) {
// Close releases the iterator and should be called at the end of iteration
func (i indexIterator) Close() error {
i.it.Close()
return nil
return i.it.Close()
}
// PrefixRange turns a prefix into a (start, end) range. The start is the given prefix value and

View File

@ -308,6 +308,5 @@ func (i typeSafeIterator) LoadNext(dest codec.ProtoMarshaler) (RowID, error) {
}
func (i typeSafeIterator) Close() error {
i.it.Close()
return nil
return i.it.Close()
}