fixed null values

This commit is contained in:
sonalyadav 2024-12-19 19:29:28 +05:30 committed by Sonal Yadav
parent 47e896f32d
commit 0f7ffc320e

View file

@ -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.") }
}
}