修复一个空指针问题

v3.6.6
laoyuyu 6 years ago
parent 1d116f71b7
commit c01c53d717
  1. 5
      Aria/src/main/java/com/arialyy/aria/core/command/normal/CancelAllCmd.java
  2. 3
      app/src/main/AndroidManifest.xml

@ -28,6 +28,7 @@ import com.arialyy.aria.core.queue.UploadTaskQueue;
import com.arialyy.aria.core.upload.UploadEntity; import com.arialyy.aria.core.upload.UploadEntity;
import com.arialyy.aria.core.upload.UploadTaskEntity; import com.arialyy.aria.core.upload.UploadTaskEntity;
import com.arialyy.aria.orm.DbEntity; import com.arialyy.aria.orm.DbEntity;
import com.arialyy.aria.util.ALog;
import java.util.List; import java.util.List;
/** /**
@ -99,6 +100,10 @@ public class CancelAllCmd<T extends AbsTaskEntity> extends AbsNormalCmd<T> {
} }
private void remove(AbsTaskEntity te) { private void remove(AbsTaskEntity te) {
if (te == null){
ALog.w(TAG, "取消任务失败,任务为空");
return;
}
if (te instanceof DownloadTaskEntity) { if (te instanceof DownloadTaskEntity) {
mQueue = DownloadTaskQueue.getInstance(); mQueue = DownloadTaskQueue.getInstance();
} else if (te instanceof UploadTaskEntity) { } else if (te instanceof UploadTaskEntity) {

@ -16,10 +16,9 @@
<!--android:name=".test.TestActivity"--> <!--android:name=".test.TestActivity"-->
<!--android:name=".test.AnyRunActivity"--> <!--android:name=".test.AnyRunActivity"-->
<!--android:name=".download.group.DownloadGroupActivity"--> <!--android:name=".download.group.DownloadGroupActivity"-->
<!--android:name=".test.TestGroupActivity"-->
<!--android:name=".MainActivity"--> <!--android:name=".MainActivity"-->
<activity <activity
android:name="com.arialyy.simple.test.AnyRunActivity" android:name=".test.TestGroupActivity"
android:label="@string/app_name"> android:label="@string/app_name">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>

Loading…
Cancel
Save