Skip to content

Commit

Permalink
fix: ArrayIndexOutOfBoundsException in DownloadController SparseArray
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Sep 11, 2024
1 parent 0393a01 commit 0736604
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;

import cn.hutool.core.util.StrUtil;
import tw.nekomimi.nekogram.NekoConfig;
Expand Down Expand Up @@ -72,19 +73,19 @@ public interface FileDownloadProgressListener {

private HashMap<String, ArrayList<WeakReference<FileDownloadProgressListener>>> loadingFileObservers = new HashMap<>();
private HashMap<String, ArrayList<MessageObject>> loadingFileMessagesObservers = new HashMap<>();
private SparseArray<String> observersByTag = new SparseArray<>();
private ConcurrentHashMap<Integer, String> observersByTag = new ConcurrentHashMap<>();
private boolean listenerInProgress = false;
private HashMap<String, FileDownloadProgressListener> addLaterArray = new HashMap<>();
private ArrayList<FileDownloadProgressListener> deleteLaterArray = new ArrayList<>();
private int lastTag = 0;

private boolean loadingAutoDownloadConfig;

private LongSparseArray<Long> typingTimes = new LongSparseArray<>();
private ConcurrentHashMap<Long, Long> typingTimes = new ConcurrentHashMap<>();

public final ArrayList<MessageObject> downloadingFiles = new ArrayList<>();
public final ArrayList<MessageObject> recentDownloadingFiles = new ArrayList<>();
public final SparseArray<MessageObject> unviewedDownloads = new SparseArray<>();
public final ConcurrentHashMap<Integer, MessageObject> unviewedDownloads = new ConcurrentHashMap<>();

public static class Preset {
public int[] mask = new int[4];
Expand Down

0 comments on commit 0736604

Please sign in to comment.