From 882fbf927567c617d70510a888c0ebee6ddbc189 Mon Sep 17 00:00:00 2001 From: DafabHoid Date: Fri, 18 May 2018 18:18:37 +0200 Subject: [PATCH] Fix crash on loading not yet finished downloads from .giga files --- .../main/java/us/shandian/giga/get/DownloadMission.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/src/main/java/us/shandian/giga/get/DownloadMission.java b/app/src/main/java/us/shandian/giga/get/DownloadMission.java index c48e5ffbc..f02eaae28 100644 --- a/app/src/main/java/us/shandian/giga/get/DownloadMission.java +++ b/app/src/main/java/us/shandian/giga/get/DownloadMission.java @@ -5,6 +5,7 @@ import android.os.Looper; import android.util.Log; import java.io.File; +import java.io.ObjectInputStream; import java.io.Serializable; import java.lang.ref.WeakReference; import java.util.ArrayList; @@ -312,6 +313,13 @@ public class DownloadMission implements Serializable { } } + private void readObject(ObjectInputStream inputStream) + throws java.io.IOException, ClassNotFoundException + { + inputStream.defaultReadObject(); + mListeners = new ArrayList<>(); + } + private void deleteThisFromFile() { new File(getMetaFilename()).delete(); }