Prevents crashing when the titleLayout is not initialised - #19665
Merged
Conversation
Contributor
|
| App Name | WordPress |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr19665-1807a0d | |
| Commit | 1807a0d | |
| Direct Download | wordpress-prototype-build-pr19665-1807a0d.apk |
Contributor
|
| App Name | Jetpack |
|
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr19665-1807a0d | |
| Commit | 1807a0d | |
| Direct Download | jetpack-prototype-build-pr19665-1807a0d.apk |
Generated by 🚫 dangerJS |
thomashorta
approved these changes
Nov 24, 2023
thomashorta
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix @antonis, the code looks good to me. I was also not able to reproduce it but the code seems to avoid the crash when hardcoding the null value, with the side-effect you mentioned in the PR description.
![]()
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #19660
Description
This PR prevents the app from crashing when the
titleLayouthas not yet been initialised in theonPreDrawof the post list row.Note: I wasn't able to recreate the conditions of the crash thus I consider that this might be an extreme scenario and handled the null case causing the crash. The crash seems to occur after closing the editor on the posts list. I've tried different scenarios with long and short titles, and with long post list so that the
d/WordPress-API: : ListStore: Loading next pagecall is triggered as indicated from the Sentry breadcrumb.To test the behaviour of the app when the
titleLayoutis null I hardcoded the value (L:134) and the app behaved normally with the only side effect being to render only one line for the excerpt.To Test:
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.txtif necessary.UI Changes Testing Checklist: