catch number format exception in server ack

This commit is contained in:
Daniel Gultsch 2015-07-10 12:09:59 +02:00
parent 26044ca229
commit 7eac30d1f4

View file

@ -366,6 +366,7 @@ public class XmppConnection implements Runnable {
} else if (nextTag.isStart("a")) {
final Element ack = tagReader.readElement(nextTag);
lastPacketReceived = SystemClock.elapsedRealtime();
try {
final int serverSequence = Integer.parseInt(ack.getAttribute("h"));
if (Config.EXTENDED_SM_LOGGING) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": server acknowledged stanza #" + serverSequence);
@ -378,6 +379,9 @@ public class XmppConnection implements Runnable {
}
this.messageReceipts.remove(serverSequence);
}
} catch (NumberFormatException e) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": server send ack without sequence number");
}
} else if (nextTag.isStart("failed")) {
tagReader.readElement(nextTag);
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": resumption failed");