-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closes #3061 #3062
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
Closes #3061 #3062
Conversation
* Added null check for contribution with position in ContributionsListFragment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ A review job has been created and sent to the PullRequest network.
Check the status or cancel PullRequest code review here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to make sure this change works as expected?
Codecov Report
@@ Coverage Diff @@
## master #3062 +/- ##
=========================================
- Coverage 4.66% 4.66% -0.01%
=========================================
Files 264 264
Lines 12359 12364 +5
Branches 1052 1054 +2
=========================================
Hits 577 577
- Misses 11739 11744 +5
Partials 43 43
Continue to review full report at Codecov.
|
neslihanturan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ashishkumar468 for fast reply, it seems like it will prevent the NPE but do you think he cause of the NPE worth to solve? Or is it just an expected NPE?
|
@neslihanturan The NPE is happening because we are trying to fetch the id of the contribution from the cursor position and if the cursor gets closed somehow and we try to fetch the id then, null value will be returned, and that is why I have handled that. With the cursor based implementation, there are chances of the cursor getting closed when the app goes in background (Handled by the framework with the current implementation as far as I understand). An effect of this will be that in such cases, the position will not be retained on configuration changes. |
|
This should solve your reported issue @PavelAplevich |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PullRequest network review has been cancelled
You can reactivate the code review job from the PullRequest dashboard - or - by adding [pr] to the title of this code review.
|
@neslihanturan @ashishkumar468 With this fix, app looks good. I think all works correctly |
|
Thanks @ashishkumar468 and @PavelAplevich ! |
* Added null check for contribution with position in ContributionsListFragment
* Added null check for contribution with position in ContributionsListFragment
Description (required)
Fixes #3061 App Crashes in ContributionListFragment
What changes did you make and why?
Null checks on Contribution before extracting the uri's lastPathSegment
Tests performed (required)
Tested betaDebug on Pixel Api 27