only add enclosure if there's one

This commit is contained in:
Athou
2014-12-11 08:32:48 +01:00
parent a19b5090bf
commit ece38c9e59

View File

@@ -77,10 +77,12 @@ public class Entry implements Serializable {
content.setValue(getContent()); content.setValue(getContent());
entry.setContents(Arrays.<SyndContent> asList(content)); entry.setContents(Arrays.<SyndContent> asList(content));
SyndEnclosureImpl enclosure = new SyndEnclosureImpl(); if (getEnclosureUrl() != null) {
enclosure.setType(getEnclosureType()); SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
enclosure.setUrl(getEnclosureUrl()); enclosure.setType(getEnclosureType());
entry.setEnclosures(Arrays.<SyndEnclosure> asList(enclosure)); enclosure.setUrl(getEnclosureUrl());
entry.setEnclosures(Arrays.<SyndEnclosure> asList(enclosure));
}
entry.setLink(getUrl()); entry.setLink(getUrl());
entry.setPublishedDate(getDate()); entry.setPublishedDate(getDate());