mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-17 22:35:08 -05:00
wraped stanza writer in try catch
This commit is contained in:
parent
eb21475658
commit
16c63c91e2
@ -78,13 +78,19 @@ public class TagWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TagWriter writeStanzaAsync(AbstractStanza stanza) {
|
public TagWriter writeStanzaAsync(AbstractStanza stanza) {
|
||||||
|
try {
|
||||||
if (finshed) {
|
if (finshed) {
|
||||||
return this;
|
return this;
|
||||||
} else {
|
} else {
|
||||||
if (!asyncStanzaWriter.isAlive()) asyncStanzaWriter.start();
|
if (!asyncStanzaWriter.isAlive()) {
|
||||||
|
asyncStanzaWriter.start();
|
||||||
|
}
|
||||||
writeQueue.add(stanza);
|
writeQueue.add(stanza);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
} catch (IllegalThreadStateException e) {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finish() {
|
public void finish() {
|
||||||
|
Loading…
Reference in New Issue
Block a user