Check feed icon url nullability

This commit is contained in:
Shinokuni 2020-02-15 13:37:26 +01:00
parent 4f2618021e
commit 54566bbc4e
1 changed files with 9 additions and 6 deletions

View File

@ -43,12 +43,15 @@ class SyncResultAnalyser(val context: Context, private val syncResults: Map<Acco
val feed = database.feedDao().getFeedById(feedsIdsForNewItems.first()) val feed = database.feedDao().getFeedById(feedsIdsForNewItems.first())
title = feed?.name title = feed?.name
val target = GlideApp.with(context) feed?.iconUrl?.let {
.asBitmap() val target = GlideApp.with(context)
.load(feed?.iconUrl) .asBitmap()
.diskCacheStrategy(DiskCacheStrategy.ALL) .load(it)
.submit() .diskCacheStrategy(DiskCacheStrategy.ALL)
largeIcon = target.get() .submit()
largeIcon = target.get()
}
contentText = if (syncResult.items.size == 1) contentText = if (syncResult.items.size == 1)
syncResult.items.first().title syncResult.items.first().title