wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
673 stars 114 forks source link

Safely parse color string #1079

Closed antonis closed 1 week ago

antonis commented 1 week ago

Fixes https://github.com/wordpress-mobile/WordPress-Android/issues/20694 and https://github.com/wordpress-mobile/WordPress-Android/issues/20698

Related PRs:

Fix

This PR adds exception handling for the Color.parseColor function call to prevent the app from crashing. Similar handling is done in two other case in Aztec (one, two)

Test

I was not able to reproduce the crash thus I suggest a sanity check of the functionality introduced in https://github.com/wordpress-mobile/AztecEditor-Android/pull/1073

Make sure strings will be translated: