From 2ae0ecec3a947776be2355b1fbfc9b0334b59fc3 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 26 Aug 2018 14:55:21 +0200 Subject: do grace period calculation only on positive periods --- src/main/java/de/pixart/messenger/entities/Account.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/de/pixart/messenger/entities/Account.java b/src/main/java/de/pixart/messenger/entities/Account.java index a8c72cdf9..46d036419 100644 --- a/src/main/java/de/pixart/messenger/entities/Account.java +++ b/src/main/java/de/pixart/messenger/entities/Account.java @@ -638,8 +638,10 @@ public class Account extends AbstractEntity { return this.avatar; } - public void activateGracePeriod(long duration) { - this.mEndGracePeriod = SystemClock.elapsedRealtime() + duration; + public void activateGracePeriod(final long duration) { + if (duration > 0) { + this.mEndGracePeriod = SystemClock.elapsedRealtime() + duration; + } } public void deactivateGracePeriod() { -- cgit v1.2.3