From 5e0ad1c526ac910e14d107c10f41b43ebb7c84cf Mon Sep 17 00:00:00 2001 From: Pierre Date: Fri, 20 Apr 2018 09:52:32 +0200 Subject: [PATCH] Try to fix issue. --- .../android/comunic/client/data/helpers/ImageLoadHelper.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java index daf96b7..8cd1235 100644 --- a/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java +++ b/app/src/main/java/org/communiquons/android/comunic/client/data/helpers/ImageLoadHelper.java @@ -101,6 +101,7 @@ public class ImageLoadHelper { private static void clean(){ //Get the list of threads + int i = 0; for(View view : threads.keySet()){ if(threads.get(view) != null) @@ -108,6 +109,10 @@ public class ImageLoadHelper { if(!threads.get(view).isAlive()) threads.remove(view); + //Avoid ArrayIndexOutOfBoundsException + i++; + if(threads.size() < i) + return; } }