diff --git a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java index f9e2d9583..7e80264e6 100644 --- a/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java +++ b/app/src/main/java/org/schabi/newpipe/local/subscription/SubscriptionService.java @@ -147,11 +147,16 @@ public class SubscriptionService { } private boolean isSubscriptionUpToDate(final ChannelInfo info, final SubscriptionEntity entity) { - return info.getUrl().equals(entity.getUrl()) && + return equalsAndNotNull(info.getUrl(), entity.getUrl()) && info.getServiceId() == entity.getServiceId() && info.getName().equals(entity.getName()) && - info.getAvatarUrl().equals(entity.getAvatarUrl()) && - info.getDescription().equals(entity.getDescription()) && + equalsAndNotNull(info.getAvatarUrl(), entity.getAvatarUrl()) && + equalsAndNotNull(info.getDescription(), entity.getDescription()) && info.getSubscriberCount() == entity.getSubscriberCount(); } + + private boolean equalsAndNotNull(final Object o1, final Object o2) { + return (o1 != null && o2 != null) + && o1.equals(o2); + } }