Avoid NPE when rendering empty markdown (#2626)
This commit is contained in:
parent
bc381f4bb5
commit
b178215f2f
|
|
@ -153,7 +153,7 @@ public class RepoItemFragment extends BaseFragment implements RepoLoader.RepoLis
|
|||
}
|
||||
}
|
||||
|
||||
private void renderGithubMarkdown(WebView view, String text) {
|
||||
private void renderGithubMarkdown(WebView view, @Nullable String text) {
|
||||
try {
|
||||
view.setBackgroundColor(Color.TRANSPARENT);
|
||||
var setting = view.getSettings();
|
||||
|
|
@ -173,6 +173,9 @@ public class RepoItemFragment extends BaseFragment implements RepoLoader.RepoLis
|
|||
} else {
|
||||
direction = "ltr";
|
||||
}
|
||||
if (text == null) {
|
||||
text = "<center>" + App.getInstance().getString(R.string.list_empty) + "</center>";
|
||||
}
|
||||
if (ResourceUtils.isNightMode(getResources().getConfiguration())) {
|
||||
body = App.HTML_TEMPLATE_DARK.get().replace("@dir@", direction).replace("@body@", text);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue