don’t let attempt count fall below zero

This commit is contained in:
Daniel Gultsch 2016-05-10 17:48:09 +02:00
parent c37b5af2ca
commit 8e3948e495
1 changed files with 1 additions and 1 deletions

View File

@ -355,7 +355,7 @@ public class XmppConnection implements Runnable {
} catch (final IOException | XmlPullParserException | NoSuchAlgorithmException e) {
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": " + e.getMessage());
this.changeStatus(Account.State.OFFLINE);
this.attempt--; //don't count attempt when reconnecting instantly anyway
this.attempt = Math.max(0, this.attempt - 1);
} finally {
forceCloseSocket();
if (wakeLock.isHeld()) {