Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
8Duke8 opened this issue Jan 23, 2024 · 5 comments

Comments

@8Duke8
Copy link

8Duke8 commented Jan 23, 2024

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
Copy link
Author

8Duke8 commented Jan 23, 2024

I use the latest version 1.11.6.

@uzair-ird
Copy link

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

@mitskovets
Copy link

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 } ]

@adminant
Copy link

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

@mitskovets
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants