File tree Expand file tree Collapse file tree
app/src/main/java/org/schabi/newpipe Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .schabi .newpipe .database .subscription ;
22
33import androidx .annotation .NonNull ;
4+ import androidx .annotation .Nullable ;
45import androidx .room .ColumnInfo ;
56import androidx .room .Entity ;
67import androidx .room .Ignore ;
@@ -95,11 +96,12 @@ public void setName(final String name) {
9596 this .name = name ;
9697 }
9798
99+ @ Nullable
98100 public String getAvatarUrl () {
99101 return avatarUrl ;
100102 }
101103
102- public void setAvatarUrl (final String avatarUrl ) {
104+ public void setAvatarUrl (@ Nullable final String avatarUrl ) {
103105 this .avatarUrl = avatarUrl ;
104106 }
105107
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ data class FeedUpdateInfo(
1818 @NotificationMode
1919 val notificationMode : Int ,
2020 val name : String ,
21- val avatarUrl : String ,
21+ val avatarUrl : String? ,
2222 val url : String ,
2323 val serviceId : Int ,
2424 // description and subscriberCount are null if the constructor info is from the fast feed method
Original file line number Diff line number Diff line change @@ -100,7 +100,9 @@ class SubscriptionManager(context: Context) {
100100 val subscriptionEntity = subscriptionTable.getSubscription(info.uid)
101101
102102 subscriptionEntity.name = info.name
103- subscriptionEntity.avatarUrl = info.avatarUrl
103+
104+ // some services do not provide an avatar URL
105+ info.avatarUrl?.let { subscriptionEntity.avatarUrl = it }
104106
105107 // these two fields are null if the feed info was fetched using the fast feed method
106108 info.description?.let { subscriptionEntity.description = it }
You can’t perform that action at this time.
0 commit comments