Prevent crash

This commit is contained in:
M66B 2019-10-10 15:29:39 +02:00
parent 0f9734c7bd
commit 5dbfd2bc8f
1 changed files with 7 additions and 2 deletions

View File

@ -1592,7 +1592,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return; return;
boolean has_images = args.getBoolean("has_images"); boolean has_images = args.getBoolean("has_images");
boolean show_images = properties.getValue("images", message.id);
if (result instanceof Spanned) { if (result instanceof Spanned) {
tvBody.setText((Spanned) result); tvBody.setText((Spanned) result);
@ -1601,7 +1600,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvBody.setMovementMethod(new TouchHandler(message)); tvBody.setMovementMethod(new TouchHandler(message));
} else if (result instanceof String) } else if (result instanceof String)
((WebView) wvBody).loadDataWithBaseURL(null, (String) result, "text/html", "UTF-8", null); ((WebView) wvBody).loadDataWithBaseURL(null, (String) result, "text/html", "UTF-8", null);
else else if (result == null) {
boolean show_full = args.getBoolean("show_full");
if (show_full)
((WebView) wvBody).loadDataWithBaseURL(null, "", "text/html", "UTF-8", null);
else
tvBody.setText(null);
} else
throw new IllegalStateException("Result=" + result); throw new IllegalStateException("Result=" + result);
pbBody.setVisibility(View.GONE); pbBody.setVisibility(View.GONE);