<enclosure> tag attributes aren't required

This commit is contained in:
Shinokuni 2020-07-14 21:28:33 +02:00
parent cc8c940ee5
commit b98b8853ec
2 changed files with 4 additions and 3 deletions

View File

@ -47,7 +47,8 @@ public final class ItemMatcher {
} else {
if (item.getEnclosures() != null) {
for (RSSEnclosure enclosure : item.getEnclosures()) {
if (enclosure.getType() != null && Utils.isTypeImage(enclosure.getType())) {
if (enclosure.getType() != null && Utils.isTypeImage(enclosure.getType())
&& enclosure.getUrl() != null) {
newItem.setImageLink(enclosure.getUrl());
break;
}

View File

@ -6,10 +6,10 @@ import org.simpleframework.xml.Root;
@Root(name = "enclosure", strict = false)
public class RSSEnclosure {
@Attribute
@Attribute(required = false)
private String type;
@Attribute
@Attribute(required = false)
private String url;
public String getType() {