flutter_downloader icon indicating copy to clipboard operation
flutter_downloader copied to clipboard

Nullpointer exception on httpconn.contentType in DownloadWorker.kt if contentType is not provided by the server.

Open 8Duke8 opened this issue 1 year ago • 6 comments

D/DownloadWorker( 7364): Update notification: {notificationId: 5, title: offlineMapCZ.map, status: FAILED, progress: -1} W/System.err( 7364): java.lang.NullPointerException: httpConn.contentType must not be null W/System.err( 7364): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:343) W/System.err( 7364): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206) W/System.err( 7364): at androidx.work.Worker$1.run(Worker.java:86) W/System.err( 7364): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) W/System.err( 7364): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) W/System.err( 7364): at java.lang.Thread.run(Thread.java:1012)

The contentType should be handled as optional if possible.

8Duke8 avatar Jan 23 '24 09:01 8Duke8

I use the latest version 1.11.6.

8Duke8 avatar Jan 23 '24 09:01 8Duke8

Any luck ? i am facing the same issue ?? @8Duke8

uzair-ird avatar Feb 01 '24 09:02 uzair-ird

I have the same problem, version 1.11.7, Android 10 D/DownloadWorker(19750): Update notification: {notificationId: 36, title: -----image url-----, status: FAILED, progress: -1} W/System.err(19750): java.lang.NullPointerException W/System.err(19750): at vn.hunghd.flutterdownloader.DownloadWorker.downloadFile(DownloadWorker.kt:389) W/System.err(19750): at vn.hunghd.flutterdownloader.DownloadWorker.doWork(DownloadWorker.kt:206) W/System.err(19750): at androidx.work.Worker$1.run(Worker.java:86) W/System.err(19750): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/System.err(19750): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/System.err(19750): at java.lang.Thread.run(Thread.java:919) I/WM-WorkerWrapper(19750): Worker result FAILURE for Work [ id=51508954-9a1d-4ead-88ae-d1827c66d0d4, tags={ flutter_download_task, vn.hunghd.flutterdownloader.DownloadWorker } ]

mitskovets avatar May 17 '24 04:05 mitskovets

I have the same issue, does anyone have an idea how to fix?

adminant avatar May 17 '24 11:05 adminant

I checked again, the situation is like this: When downloading a new file, there are no errors. And when downloading again. But if you delete all downloaded files, downloading again results in an error. If you always give files unique names when downloading, then there will be no errors even after deleting all the files.

mitskovets avatar May 17 '24 12:05 mitskovets

I have the same issue, does anybody know how to fix this?

ZRShamim avatar Jun 30 '24 07:06 ZRShamim