diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-06-25 17:15:40 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-06-25 17:15:40 +0200 |
commit | 16c63c91e25b9139b2a2f228cd76817343521a6f (patch) | |
tree | b936afa33830c0994cb1a09379809ff526c727fb /src/eu/siacs | |
parent | eb21475658151787dc9c0eedde9c168a7aedf6ae (diff) |
wraped stanza writer in try catch
Diffstat (limited to 'src/eu/siacs')
-rw-r--r-- | src/eu/siacs/conversations/xml/TagWriter.java | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/eu/siacs/conversations/xml/TagWriter.java b/src/eu/siacs/conversations/xml/TagWriter.java index ef1e8555..95436f05 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; } } |