aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-25 17:15:40 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-25 17:15:40 +0200
commit16c63c91e25b9139b2a2f228cd76817343521a6f (patch)
treeb936afa33830c0994cb1a09379809ff526c727fb /src
parenteb21475658151787dc9c0eedde9c168a7aedf6ae (diff)
wraped stanza writer in try catch
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/xml/TagWriter.java16
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;
}
}