wordpress-mobile / WordPress-Android

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

Fix UninitializedPropertyAccessException in EditorJetpackSocialViewModel #20672

Closed RenanLukas closed 4 weeks ago

RenanLukas commented 4 weeks ago

Fixes #20662

Even though I couldn't reproduce the crash, the root cause seem to be a race condition that makes the method EditorJetpackSocialViewModel#shouldShowJetpackSocial be called before editPostRepository is initialized. As a quick fix to avoid crashing, I'm checking if the variable was initialized before using it.


To Test:


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)

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

    --


PR Submission Checklist:


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

dangermattic commented 4 weeks ago
1 Warning
:warning: PR is not assigned to a milestone.

Generated by :no_entry_sign: Danger

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
Versionpr20672-f75300f
Commitf75300f60608624fada4a30b613e31a0b78d3309
Direct Downloadjetpack-prototype-build-pr20672-f75300f.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
Versionpr20672-f75300f
Commitf75300f60608624fada4a30b613e31a0b78d3309
Direct Downloadwordpress-prototype-build-pr20672-f75300f.apk
Note: Google Login is not supported on these builds.
codecov[bot] commented 4 weeks ago

Codecov Report

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

Project coverage is 40.46%. Comparing base (e87136d) to head (f75300f).

Files Patch % Lines
...s/android/ui/posts/EditorJetpackSocialViewModel.kt 0.00% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## release/24.7 #20672 +/- ## ================================================ - Coverage 40.46% 40.46% -0.01% ================================================ Files 1484 1484 Lines 68416 68417 +1 Branches 11307 11308 +1 ================================================ - Hits 27683 27682 -1 Misses 38233 38233 - Partials 2500 2502 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.