aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/xml
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-06 15:22:56 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-04-06 15:22:56 +0200
commit3f872ddc9f56255ac090260ec720b04a523cf695 (patch)
treea1986194819ff3e19f7b2e2ac0edd766ce3fee38 /src/eu/siacs/conversations/xml
parent3f617429026bc0b43b987433ea15b3b623dd042b (diff)
fixed npe
Diffstat (limited to 'src/eu/siacs/conversations/xml')
-rw-r--r--src/eu/siacs/conversations/xml/TagWriter.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/xml/TagWriter.java b/src/eu/siacs/conversations/xml/TagWriter.java
index d945b47b..40d5b328 100644
--- a/src/eu/siacs/conversations/xml/TagWriter.java
+++ b/src/eu/siacs/conversations/xml/TagWriter.java
@@ -47,18 +47,27 @@ public class TagWriter {
}
public TagWriter beginDocument() throws IOException {
+ if (outputStream==null) {
+ throw new IOException("output stream was null");
+ }
outputStream.write("<?xml version='1.0'?>");
outputStream.flush();
return this;
}
public TagWriter writeTag(Tag tag) throws IOException {
+ if (outputStream==null) {
+ throw new IOException("output stream was null");
+ }
outputStream.write(tag.toString());
outputStream.flush();
return this;
}
public TagWriter writeElement(Element element) throws IOException {
+ if (outputStream==null) {
+ throw new IOException("output stream was null");
+ }
outputStream.write(element.toString());
outputStream.flush();
return this;