Closed zwarm closed 3 weeks ago
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code
App Name | Jetpack | |
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr20676-6b3dfc5 | |
Commit | 6b3dfc57e8bf41b63468d986e4871235c7c3ae55 | |
Direct Download | jetpack-prototype-build-pr20676-6b3dfc5.apk |
App Name | WordPress | |
Flavor | Jalapeno | |
Build Type | Debug | |
Version | pr20676-6b3dfc5 | |
Commit | 6b3dfc57e8bf41b63468d986e4871235c7c3ae55 | |
Direct Download | wordpress-prototype-build-pr20676-6b3dfc5.apk |
Fixes #20673
This PR addresses an issue where the lateinit property siteModel was not being initialized under certain circumstances. The problem occurred when the finish() method did not execute immediately after initialization failure, causing the activity to continue execution despite siteModel being uninitialized.
To resolve this issue, I refactored the initializeSiteModelAndFinishIfNeeded method, now called initializeSiteModel, to return a Boolean indicating whether siteModel was successfully initialized. If siteModel could not be initialized, the method now returns false. In onCreate(), I introduced a check to immediately call finish() if the method returns false
This change ensures that siteModel is properly initialized, and the activity is promptly terminated if initialization fails, thus preventing runtime errors related to lateinit property initialization.
Note: I could not recreate the issue live, but I could by setting onCreate() to immediately finish() and then validating that the next line was still executed.
To Test:
Validate the app doesn't crash
Regression Notes
Potential unintended areas of impact Edit Post does not work
What I did to test those areas of impact (or what existing automated tests I relied on) Manual testing
What automated tests I added (or what prevented me from doing so) N/A
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones): N/A