-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 crash in ReaderActivityLauncher #20848
Conversation
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #20848 +/- ##
==========================================
- Coverage 40.67% 40.66% -0.01%
==========================================
Files 1490 1490
Lines 68631 68634 +3
Branches 11342 11344 +2
==========================================
Hits 27913 27913
- Misses 38197 38200 +3
Partials 2521 2521 ☔ View full report in Codecov by Sentry. |
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.
@aditi-bhatia, would you like to fix this using NonNull
annotations? There are already warnings for parameters that don't have NonNull
or Nullable
annotations in the Java classes. When you add the NonNull
annotation, other places that call these functions will show errors, and it also prevents calling this function with nullable parameters in the future.
For more info: There is an internal project (paaHJt-5fa-p2) for nullability annotations that we can assist with.
Hi @irfano, thanks for the suggestion, the lack of annotations in the codebase was also something that I was concerned about. I spent some time looking into adding
From what I understand, So from what I understand, adding |
Hi @irfano, thank you for the input 👍 I've added NonNull annotations as well as null checks in the calling functions if you'd like to take another look. |
...ress/src/main/java/org/wordpress/android/ui/notifications/NotificationsDetailListFragment.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderPostDetailFragment.kt
Outdated
Show resolved
Hide resolved
WordPress/src/main/java/org/wordpress/android/ui/reader/ReaderActivityLauncher.java
Show resolved
Hide resolved
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.
I left two nitpicking comments and one for minor request to add the NonNull
annotation. It was like a puzzle to find all possible instances of null parameters. 😅 Thanks for your effort! I'm approving, and you can merge after considering my comments.
Quality Gate passedIssues Measures |
Thanks for the review @irfano! I addressed the comments you made above and will go ahead and merge. |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Fixes #20847
This PR addresses a crash related to
context
being null when callingbuildShowReaderCommentsIntent()
.To Test:
I haven't been able to reproduce this crash, so code check + smoke test comments on the Reader.
Regression Notes
Potential unintended areas of impact
What I did to test those areas of impact (or what existing automated tests I relied on)
What automated tests I added (or what prevented me from doing so)
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones):
WordPress.com sites and self-hosted Jetpack sites.Portrait and landscape orientations.Light and dark modes.Fonts: Larger, smaller and bold text.High contrast.Talkback.Languages with large words or with letters/accents not frequently used in English.Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)Large and small screen sizes. (Tablet and smaller phones)Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)