From 16c63c91e25b9139b2a2f228cd76817343521a6f Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Wed, 25 Jun 2014 17:15:40 +0200 Subject: [PATCH] wraped stanza writer in try catch --- src/eu/siacs/conversations/xml/TagWriter.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/eu/siacs/conversations/xml/TagWriter.java b/src/eu/siacs/conversations/xml/TagWriter.java index ef1e8555f..95436f050 100644 --- a/src/eu/siacs/conversations/xml/TagWriter.java +++ b/src/eu/siacs/conversations/xml/TagWriter.java @@ -78,11 +78,17 @@ public class TagWriter { } public TagWriter writeStanzaAsync(AbstractStanza stanza) { - if (finshed) { - return this; - } else { - if (!asyncStanzaWriter.isAlive()) asyncStanzaWriter.start(); - writeQueue.add(stanza); + try { + if (finshed) { + return this; + } else { + if (!asyncStanzaWriter.isAlive()) { + asyncStanzaWriter.start(); + } + writeQueue.add(stanza); + return this; + } + } catch (IllegalThreadStateException e) { return this; } }