From ad9b9b9096e05bfdb63615a8e896b001116e10f9 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 13 May 2014 10:23:26 +0200 Subject: [PATCH] fixed npe in tag writer --- src/eu/siacs/conversations/xml/TagWriter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/eu/siacs/conversations/xml/TagWriter.java b/src/eu/siacs/conversations/xml/TagWriter.java index 40d5b3289..ef1e8555f 100644 --- a/src/eu/siacs/conversations/xml/TagWriter.java +++ b/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) {