fixed npe in tag writer

Daniel Gultsch created

Change summary

src/eu/siacs/conversations/xml/TagWriter.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

Detailed changes

src/eu/siacs/conversations/xml/TagWriter.java 🔗

@@ -23,8 +23,12 @@ public class TagWriter {
 				}
 				try {
 					AbstractStanza output = writeQueue.take();
-					outputStream.write(output.toString());
-					outputStream.flush();
+					if (outputStream==null) {
+						shouldStop = true;
+					} else {
+						outputStream.write(output.toString());
+						outputStream.flush();
+					}
 				} catch (IOException e) {
 					shouldStop = true;
 				} catch (InterruptedException e) {