Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Panic: Check For Error Before Defer #482

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Apr 9, 2024

Describe your changes and provide context

  • Checks for err before defer
  • Without this, if there is a err, the node will panic on the defer because scStore is nil

Testing performed to validate your change

  • Verified on node

@Kbhat1 Kbhat1 changed the title Check err before defer Check For Error Before Defer Apr 9, 2024
@Kbhat1 Kbhat1 requested a review from yzang2019 April 9, 2024 22:49
@Kbhat1 Kbhat1 changed the title Check For Error Before Defer Fix Panic: Check For Error Before Defer Apr 9, 2024
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 55.35%. Comparing base (35e6b74) to head (b8bd97d).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            seiv2     #482      +/-   ##
==========================================
- Coverage   55.35%   55.35%   -0.01%     
==========================================
  Files         629      629              
  Lines       53963    53963              
==========================================
- Hits        29872    29871       -1     
- Misses      21957    21958       +1     
  Partials     2134     2134              
Files Coverage Δ
storev2/rootmulti/store.go 3.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

@Kbhat1 Kbhat1 merged commit 7fd82bd into seiv2 Apr 10, 2024
13 checks passed
@Kbhat1 Kbhat1 deleted the CheckErrBeforeDefer branch April 10, 2024 17:29
udpatil pushed a commit that referenced this pull request Apr 16, 2024
## Describe your changes and provide context
- Checks for err before `defer`
- Without this, if there is a err, the node will panic on the `defer`
because `scStore` is `nil`

## Testing performed to validate your change
- Verified on node
udpatil pushed a commit that referenced this pull request Apr 19, 2024
## Describe your changes and provide context
- Checks for err before `defer`
- Without this, if there is a err, the node will panic on the `defer`
because `scStore` is `nil`

## Testing performed to validate your change
- Verified on node
udpatil pushed a commit that referenced this pull request Apr 19, 2024
## Describe your changes and provide context
- Checks for err before `defer`
- Without this, if there is a err, the node will panic on the `defer`
because `scStore` is `nil`

## Testing performed to validate your change
- Verified on node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants