Fix NPE when avatarUrl is empty
This commit is contained in:
parent
0ba73b11c1
commit
3738e30949
3 changed files with 7 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ data class FeedUpdateInfo(
|
|||
@NotificationMode
|
||||
val notificationMode: Int,
|
||||
val name: String,
|
||||
val avatarUrl: String,
|
||||
val avatarUrl: String?,
|
||||
val url: String,
|
||||
val serviceId: Int,
|
||||
// description and subscriberCount are null if the constructor info is from the fast feed method
|
||||
|
|
|
|||
|
|
@ -100,7 +100,9 @@ class SubscriptionManager(context: Context) {
|
|||
val subscriptionEntity = subscriptionTable.getSubscription(info.uid)
|
||||
|
||||
subscriptionEntity.name = info.name
|
||||
subscriptionEntity.avatarUrl = info.avatarUrl
|
||||
|
||||
// some services do not provide an avatar URL
|
||||
info.avatarUrl?.let { subscriptionEntity.avatarUrl = it }
|
||||
|
||||
// these two fields are null if the feed info was fetched using the fast feed method
|
||||
info.description?.let { subscriptionEntity.description = it }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue