fix: handle file close logic (#679)

* handle file close logic

* Update rpc/ethereum/namespaces/debug/utils.go

* update changelog

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
JayT106 2021-10-19 04:55:55 -04:00 committed by GitHub
parent 1076307e6b
commit c644dd6707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -57,6 +57,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (evm) [tharsis#660](https://github.com/tharsis/ethermint/pull/660) Fix `nil` pointer panic in `ApplyNativeMessage`.
* (evm, test) [tharsis#649](https://github.com/tharsis/ethermint/pull/649) Test DynamicFeeTx.
### Improvements
(rpc) [tharsis#679](https://github.com/tharsis/ethermint/pull/679) Fix file close handle.
## [v0.7.0] - 2021-10-07
### API Breaking

View File

@ -48,7 +48,11 @@ func writeProfile(name, file string, log log.Logger) error {
if err != nil {
return err
}
defer f.Close()
return p.WriteTo(f, 0)
if err := p.WriteTo(f, 0); err != nil {
f.Close()
return err
}
return f.Close()
}