Prevent crash

pull/194/merge
M66B 3 years ago
parent 43600e953c
commit 1947371740

@ -2912,11 +2912,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
for (EntityAnswer answer : data.answers) {
SpannableStringBuilder ssb = new SpannableStringBuilder(answer.name);
if (answer.color != null) {
int first = answer.name.codePointAt(0);
int count = Character.charCount(first);
ssb.setSpan(new ForegroundColorSpan(answer.color), 0, count, 0);
ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, count, 0);
ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), 0, count, 0);
}
order++;
popupMenu.getMenu().add(Menu.FIRST, order, order, ssb)

Loading…
Cancel
Save