mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-24 09:42:17 -05:00
fixed null pointer
This commit is contained in:
parent
9d2d853e1b
commit
217d18b6ac
@ -75,4 +75,8 @@ public class TagWriter {
|
|||||||
public boolean finished() {
|
public boolean finished() {
|
||||||
return (this.writeQueue.size() == 0);
|
return (this.writeQueue.size() == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isActive() {
|
||||||
|
return outputStream != null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -678,6 +678,7 @@ public class XmppConnection implements Runnable {
|
|||||||
public void sendIqPacket(IqPacket packet, OnIqPacketReceived callback) {
|
public void sendIqPacket(IqPacket packet, OnIqPacketReceived callback) {
|
||||||
String id = nextRandomId();
|
String id = nextRandomId();
|
||||||
packet.setAttribute("id", id);
|
packet.setAttribute("id", id);
|
||||||
|
packet.setFrom(account.getFullJid());
|
||||||
this.sendPacket(packet, callback);
|
this.sendPacket(packet, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,12 +762,14 @@ public class XmppConnection implements Runnable {
|
|||||||
socket.close();
|
socket.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tagWriter.finish();
|
if (tagWriter.isActive()) {
|
||||||
while(!tagWriter.finished()) {
|
tagWriter.finish();
|
||||||
//Log.d(LOGTAG,"not yet finished");
|
while(!tagWriter.finished()) {
|
||||||
Thread.sleep(100);
|
//Log.d(LOGTAG,"not yet finished");
|
||||||
|
Thread.sleep(100);
|
||||||
|
}
|
||||||
|
tagWriter.writeTag(Tag.end("stream:stream"));
|
||||||
}
|
}
|
||||||
tagWriter.writeTag(Tag.end("stream:stream"));
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.d(LOGTAG,"io exception during disconnect");
|
Log.d(LOGTAG,"io exception during disconnect");
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user