From 816e33d95502688f55eaf52ef6059951fd0769a3 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 31 Jan 2024 15:53:45 -0500 Subject: [PATCH] Ignore already cancelled --- .../conversations/entities/Conversation.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 0699cc658a42fae756b4611bbe9d72ecec4569a3..2ae5aa9749af96cb8892de67c07ed1b97742b3c7 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -3151,14 +3151,16 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl View v2 = getView(); loading = true; - loadingTimer.schedule(new TimerTask() { - @Override - public void run() { - loadingHasBeenLong = true; - if (v == null && v2 == null) return; - (v == null ? v2 : v).post(() -> notifyDataSetChanged()); - } - }, 3000); + try { + loadingTimer.schedule(new TimerTask() { + @Override + public void run() { + loadingHasBeenLong = true; + if (v == null && v2 == null) return; + (v == null ? v2 : v).post(() -> notifyDataSetChanged()); + } + }, 3000); + } catch (final IllegalStateException e) { } if (v == null && v2 == null) return; (v == null ? v2 : v).post(() -> notifyDataSetChanged());