prevent crash

This commit is contained in:
M66B
2021-08-01 07:13:38 +02:00
parent f52a4e842e
commit 7eaed34d54
2 changed files with 20 additions and 8 deletions

View File

@@ -164,10 +164,15 @@ public class HtmlEx {
}
private /* static */ String getTextDirection(Spanned text, int start, int end) {
if (TextDirectionHeuristics.FIRSTSTRONG_LTR.isRtl(text, start, end - start)) {
return " dir=\"rtl\"";
} else {
return " dir=\"ltr\"";
try {
if (TextDirectionHeuristics.FIRSTSTRONG_LTR.isRtl(text, start, end - start)) {
return " dir=\"rtl\"";
} else {
return " dir=\"ltr\"";
}
} catch (Throwable ex) {
eu.faircode.email.Log.e(ex);
return "";
}
}