Finschia / finschia-sdk

A framework for building blockchains based Finschia Mainnet that is forked from cosmos-sdk
Apache License 2.0
63 stars 30 forks source link

fix: add missing nil checks #1299

Closed 170210 closed 4 months ago

170210 commented 4 months ago

Description

There are multiple functions in the codebase missing nil checks and this PR fixed them.

This pr cherry-pick the following upstream prs

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

CLAassistant commented 4 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 3 committers have signed the CLA.

:white_check_mark: 170210
:x: odeke-em
:x: yun-yeo
You have signed the CLA already but the status is still pending? Let us recheck it.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 70.43%. Comparing base (b1c09cf) to head (f42103d).

:exclamation: Current head f42103d differs from pull request most recent head 3bea915. Consider uploading reports for the commit 3bea915 to get more accurate results

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1299/graphs/tree.svg?width=650&height=150&src=pr&token=m16qfzIPO7&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1299?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) ```diff @@ Coverage Diff @@ ## main #1299 +/- ## ========================================== - Coverage 70.43% 70.43% -0.01% ========================================== Files 643 643 Lines 54720 54724 +4 ========================================== + Hits 38542 38544 +2 - Misses 14008 14009 +1 - Partials 2170 2171 +1 ``` | [Files](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1299?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia) | Coverage Δ | | |---|---|---| | [types/coin.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1299?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-dHlwZXMvY29pbi5nbw==) | `94.72% <100.00%> (+0.02%)` | :arrow_up: | | [types/dec\_coin.go](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1299?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia#diff-dHlwZXMvZGVjX2NvaW4uZ28=) | `78.24% <60.00%> (-0.52%)` | :arrow_down: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/Finschia/finschia-sdk/pull/1299/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Finschia)