DownloadWorker: Address lint warning regarding response being non-null

Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
Aayush Gupta
2025-08-19 15:29:20 +08:00
parent a9afd0785e
commit ade4a2d7e9

View File

@@ -99,11 +99,10 @@ class DownloadWorker @AssistedInject constructor(
download = downloadDao.getDownload(inputData.getString(DownloadHelper.PACKAGE_NAME)!!)
val response = (httpClient as HttpClient).call(download.iconURL).body
if (response != null) {
val bitmap =
BitmapFactory.decodeStream(withContext(Dispatchers.IO) { response.byteStream() })
icon = bitmap.scale(96, 96)
}
val bitmap = BitmapFactory.decodeStream(
withContext(Dispatchers.IO) { response.byteStream() }
)
icon = bitmap.scale(96, 96)
} catch (exception: Exception) {
return onFailure(exception)
}