summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/syndication/namespace
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/danoeh/antennapod/syndication/namespace')
-rw-r--r--src/de/danoeh/antennapod/syndication/namespace/atom/AtomText.java14
-rw-r--r--src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java7
2 files changed, 13 insertions, 8 deletions
diff --git a/src/de/danoeh/antennapod/syndication/namespace/atom/AtomText.java b/src/de/danoeh/antennapod/syndication/namespace/atom/AtomText.java
index 16beb277b..fec20de2f 100644
--- a/src/de/danoeh/antennapod/syndication/namespace/atom/AtomText.java
+++ b/src/de/danoeh/antennapod/syndication/namespace/atom/AtomText.java
@@ -10,22 +10,24 @@ public class AtomText extends SyndElement {
public static final String TYPE_TEXT = "text";
public static final String TYPE_HTML = "html";
public static final String TYPE_XHTML = "xhtml";
-
+
private String type;
private String content;
-
+
public AtomText(String name, Namespace namespace, String type) {
super(name, namespace);
this.type = type;
}
-
+
/** Processes the content according to the type and returns it. */
public String getProcessedContent() {
- if (type.equals(TYPE_HTML)) {
+ if (type == null) {
+ return content;
+ } else if (type.equals(TYPE_HTML)) {
return StringEscapeUtils.unescapeHtml4(content);
} else if (type.equals(TYPE_XHTML)) {
return content;
- } else { // Handle as text by default
+ } else { // Handle as text by default
return content;
}
}
@@ -41,7 +43,5 @@ public class AtomText extends SyndElement {
public String getType() {
return type;
}
-
-
}
diff --git a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
index 5cfec16cb..1fe5ef2f8 100644
--- a/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
+++ b/src/de/danoeh/antennapod/syndication/namespace/atom/NSAtom.java
@@ -102,7 +102,12 @@ public class NSAtom extends Namespace {
if (state.getTagstack().size() >= 2) {
AtomText textElement = null;
- String content = state.getContentBuf().toString();
+ String content;
+ if (state.getContentBuf() != null) {
+ content = state.getContentBuf().toString();
+ } else {
+ content = new String();
+ }
SyndElement topElement = state.getTagstack().peek();
String top = topElement.getName();
SyndElement secondElement = state.getSecondTag();