mirror of
https://github.com/ev-map/EVMap.git
synced 2026-04-23 15:47:08 -04:00
Android Auto: fix NPE when image fails to load
This commit is contained in:
@@ -542,7 +542,7 @@ class ChargerDetailScreen(ctx: CarContext, val chargerSparse: ChargeLocation) :
|
||||
val url = photo.getUrl(size = size)
|
||||
val request = ImageRequest.Builder(carContext).data(url).build()
|
||||
val img =
|
||||
(carContext.imageLoader.execute(request).drawable as BitmapDrawable).bitmap
|
||||
(carContext.imageLoader.execute(request).drawable as? BitmapDrawable)?.bitmap ?: return@let
|
||||
|
||||
// draw icon on top of image
|
||||
val icon = iconGen.getBitmap(
|
||||
|
||||
Reference in New Issue
Block a user