Fix a null pointer exception

This commit is contained in:
tom79 2019-05-05 11:46:52 +02:00
parent 1d7f401cd9
commit b57831b01b
1 changed files with 7 additions and 6 deletions

View File

@ -1456,12 +1456,13 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
/*if (expand_cw) /*if (expand_cw)
holder.status_spoiler_button.setVisibility(View.GONE);*/ holder.status_spoiler_button.setVisibility(View.GONE);*/
String contentCheck = ""; String contentCheck = "";
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) String content = status.getReblog() == null?status.getContent():status.getReblog().getContent();
contentCheck = Html.fromHtml(status.getReblog() == null?status.getContent():status.getReblog().getContent(), Html.FROM_HTML_MODE_LEGACY).toString(); if( content != null) {
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
//noinspection deprecation contentCheck = Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY).toString();
contentCheck = Html.fromHtml(status.getReblog() == null?status.getContent():status.getReblog().getContent()).toString(); else
contentCheck = Html.fromHtml(content).toString();
}
if (status.getReblog() == null) { if (status.getReblog() == null) {
if (status.getSpoiler_text() != null && status.getSpoiler_text().trim().length() > 0) { if (status.getSpoiler_text() != null && status.getSpoiler_text().trim().length() > 0) {
holder.status_spoiler_container.setVisibility(View.VISIBLE); holder.status_spoiler_container.setVisibility(View.VISIBLE);