fluttercommunity / fluttercommunity/flutter_downloader

java.lang.NullPointerException(DownloadWorker.kt:395)

Open
#968 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
940
Forks
561
Avg merge
1h 18m
Merged PRs (30d)
1

Description

Throws when file already exists after enqueue and there was no task for it before. Maybe do something like showDialog AlertDialog or verify file already downloaded or continue downloading if it was only partially downloaded. I can do it but choose an option.

(DownloadWorker.kt:394) val file = createFileInAppSpecificDir(actualFilename!!, savedDir)
(DownloadWorker.kt:395) savedFilePath = file!!.path

I/NotificationManager(32113): com.my.stuff.app: notify(31, null, Notification(channel=FLUTTER_DOWNLOADER_NOTIFICATION shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x18 color=0x00000000 vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)) as user
W/System.err(32113): java.lang.NullPointerException
W/System.err(32113): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:395)
W/System.err(32113): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206)
W/System.err(32113): at androidx.work.Worker$1.run(Worker.java:82)
W/System.err(32113): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
W/System.err(32113): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
W/System.err(32113): at java.lang.Thread.run(Thread.java:1012)
I/WM-WorkerWrapper(32113): Worker result FAILURE for Work [ id=0d66443b-2b46-4c57-be0c-7405e12bf1ac, tags={ vn.hunghd.flutterdownloader.DownloadWorker, flutter_download_task } ]
D/ConnectivityManager(32113): StackLog: [android.net.ConnectivityManager.unregisterNetworkCallback(ConnectivityManager.java:5076)] [androidx.work.impl.utils.NetworkApi21.unregisterNetworkCallbackCompat(NetworkApi21.kt:31)] [androidx.work.impl.constraints.trackers.NetworkStateTracker24.stopTracking(NetworkStateTracker.kt:153)] [androidx.work.impl.constraints.trackers.ConstraintTracker.removeListener(ConstraintTracker.kt:72)] [androidx.work.impl.constraints.controllers.ConstraintController$track$1$1.invoke(ContraintControllers.kt:56)] [androidx.work.impl.constraints.controllers.ConstraintController$track$1$1.invoke(ContraintControllers.kt:55)] [kotlinx.coroutines.channels.ProduceKt.awaitClose(Produce.kt:54)] [kotlinx.coroutines.channels.ProduceKt$awaitClose$1.invokeSuspend(Unknown Source:13)] [kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)] [kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)] [androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)] [java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)] [java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)] [java.lang.Thread.run(Thread.java:1012)]

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.