mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 21:55:13 +00:00
Prevent exception
This commit is contained in:
parent
5fc5f23bc7
commit
7ae933a051
1 changed files with 6 additions and 2 deletions
|
@ -72,8 +72,12 @@ public class EditTextCompose extends AppCompatEditText {
|
|||
ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
|
||||
|
||||
String html = item.getHtmlText();
|
||||
if (html == null)
|
||||
html = "<div>" + HtmlHelper.formatPre(item.getText().toString()) + "</div>";
|
||||
if (html == null) {
|
||||
CharSequence text = item.getText();
|
||||
if (text == null)
|
||||
return false;
|
||||
html = "<div>" + HtmlHelper.formatPre(text.toString()) + "</div>";
|
||||
}
|
||||
Document document = HtmlHelper.sanitize(context, html, false, false);
|
||||
Spanned paste = HtmlHelper.fromHtml(document.html());
|
||||
|
||||
|
|
Loading…
Reference in a new issue