mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
fixed null values
This commit is contained in:
parent
47e896f32d
commit
0f7ffc320e
1 changed files with 5 additions and 2 deletions
|
|
@ -61,7 +61,10 @@ object DownloadUtils {
|
|||
req: DownloadManager.Request,
|
||||
) {
|
||||
val systemService =
|
||||
activity.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
|
||||
systemService?.enqueue(req)
|
||||
activity.getSystemService(Context.DOWNLOAD_SERVICE) as? DownloadManager
|
||||
if (systemService != null) {
|
||||
systemService.enqueue(req)
|
||||
}
|
||||
else { Timber.e("DownloadManager service not available.") }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue