wordpress-mobile / WordPress-Android

WordPress for Android
http://android.wordpress.org
GNU General Public License v2.0
2.93k stars 1.3k forks source link

Fix NPE on History List screen #20816

Closed aditi-bhatia closed 4 weeks ago

aditi-bhatia commented 4 weeks ago

Fixes #20808

This PR adds null checks to HistoryDetailContainerFragment.java to address a NPE crash in mapRevisionModelsToRevisions(). I have been unable to reproduce the crash myself but it occurs when current is null in revisions.add(new Revision(current)) (line 195).


To Test:

  1. Smoke test this screen: My Site -> Pages -> Click on a page -> Meatball menu -> History -> Click on a revision Screenshot 2024-05-14 at 6 32 54 PM

Regression Notes

  1. Potential unintended areas of impact

    • None
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • None
  3. What automated tests I added (or what prevented me from doing so)

    • None

PR Submission Checklist:


Testing Checklist (strike-out the not-applying and unnecessary ones):

sonarcloud[bot] commented 4 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

wpmobilebot commented 4 weeks ago
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20816-31615f5
Commit31615f53b4368d69ef331e561d82233d3edbd136
Direct Downloadjetpack-prototype-build-pr20816-31615f5.apk
Note: Google Login is not supported on these builds.
wpmobilebot commented 4 weeks ago
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20816-31615f5
Commit31615f53b4368d69ef331e561d82233d3edbd136
Direct Downloadwordpress-prototype-build-pr20816-31615f5.apk
Note: Google Login is not supported on these builds.