Handle feed site url and item author nullability

This commit is contained in:
Shinokuni 2020-01-15 19:16:54 +01:00
parent c5476199d8
commit aafec850bb
2 changed files with 7 additions and 2 deletions

View File

@ -172,7 +172,7 @@ public class ItemActivity extends AppCompatActivity {
Utils.setDrawableColor(dateLayout.getBackground(), itemWithFeed.getColor());
}
if (item.getAuthor() != null) {
if (item.getAuthor() != null && !item.getAuthor().isEmpty()) {
author.setText(getString(R.string.by_author, item.getAuthor()));
author.setVisibility(View.VISIBLE);
}

View File

@ -73,7 +73,12 @@ public class ReadropsWebView extends WebView {
@Nullable
private String getText() {
if (itemWithFeed.getItem().getText() != null) {
Document document = Jsoup.parse(Parser.unescapeEntities(itemWithFeed.getItem().getText(), false), itemWithFeed.getWebsiteUrl());
Document document;
if (itemWithFeed.getWebsiteUrl() != null)
document = Jsoup.parse(Parser.unescapeEntities(itemWithFeed.getItem().getText(), false), itemWithFeed.getWebsiteUrl());
else
document = Jsoup.parse(Parser.unescapeEntities(itemWithFeed.getItem().getText(), false));
formatDocument(document);