fix bug taskFail参数非空,导致闪退的问题

pull/972/head
liyuefeng 2 years ago
parent aa292e4389
commit ceff7cc7f8
  1. 4
      app/src/main/java/com/arialyy/simple/core/download/KotlinDownloadActivity.kt

@ -242,10 +242,10 @@ class KotlinDownloadActivity : BaseActivity<ActivitySingleKotlinBinding>() {
*/ */
@Download.onTaskFail @Download.onTaskFail
fun taskFail( fun taskFail(
task: com.arialyy.aria.core.task.DownloadTask, task: com.arialyy.aria.core.task.DownloadTask?,
e: Exception e: Exception
) { ) {
if (task.key == mUrl) { if (task?.key == mUrl) {
Toast.makeText(this, getString(R.string.download_fail), Toast.LENGTH_SHORT) Toast.makeText(this, getString(R.string.download_fail), Toast.LENGTH_SHORT)
.show() .show()
binding.stateStr = getString(R.string.start) binding.stateStr = getString(R.string.start)

Loading…
Cancel
Save