aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-10 17:48:09 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-10 17:48:09 +0200
commit8e3948e4954dd847f2d608b9c5018648ef09719b (patch)
treea58388dd78bb3b8c166f6d11d9efe4cce041a928 /src/main
parentc37b5af2ca12beeb2fc7e4caabde79f2e0cd16aa (diff)
don’t let attempt count fall below zero
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index 57dc4ebf..823fa0ce 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -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()) {