AztecEditor-Android
AztecEditor-Android copied to clipboard
[Bug] Fix crash and add unit test to cover the issue.
Fix
Fixes: https://github.com/wordpress-mobile/WordPress-Android/issues/20738
Fix a crash that occurs when a gutenberg post is being edited and there is a block with text color on it, it's possible for the color to be malformed or not parselable. The reasoning for how the Color is empty is not clear, but the function is clear that an empty string is possible. Added unit test to also confirm this covers both an empty and null string color.
Test
- Run the test project and ensure you see no crash.
- Ensure
MarkSpanTest
passes.
Review
@thomashorta or @antonis
Make sure strings will be translated:
- [x] If there are new strings that have to be translated, I have added them to the client's
strings.xml
as a part of the integration PR.
@thomashorta ready for re-review 🙏🏻
@thomashorta I responded to your bigger point. But I made slightly bigger changes in response. As it turns out, I didn't even need to mock anything 🤦🏻 . Since we really only care about the crashes, this makes the most sense. Appreciate you elaborating as it helped me noticed an oversight I made.