DownloadWorker: Address lint warning regarding response being non-null
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -99,11 +99,10 @@ class DownloadWorker @AssistedInject constructor(
|
|||||||
download = downloadDao.getDownload(inputData.getString(DownloadHelper.PACKAGE_NAME)!!)
|
download = downloadDao.getDownload(inputData.getString(DownloadHelper.PACKAGE_NAME)!!)
|
||||||
|
|
||||||
val response = (httpClient as HttpClient).call(download.iconURL).body
|
val response = (httpClient as HttpClient).call(download.iconURL).body
|
||||||
if (response != null) {
|
val bitmap = BitmapFactory.decodeStream(
|
||||||
val bitmap =
|
withContext(Dispatchers.IO) { response.byteStream() }
|
||||||
BitmapFactory.decodeStream(withContext(Dispatchers.IO) { response.byteStream() })
|
)
|
||||||
icon = bitmap.scale(96, 96)
|
icon = bitmap.scale(96, 96)
|
||||||
}
|
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
return onFailure(exception)
|
return onFailure(exception)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user