fix possible null item in channel id list

This commit is contained in:
Akinwale Ariwodola 2020-06-05 07:04:54 +01:00
parent 288e35dd64
commit 5f1775d478
2 changed files with 7 additions and 2 deletions

View file

@ -223,7 +223,7 @@ public class ChannelContentFragment extends Fragment implements DownloadActionLi
(List) null,
null,
canShowMatureContent ? null : new ArrayList<>(Predefined.MATURE_TAGS),
Arrays.asList(channelId),
!Helper.isNullOrEmpty(channelId) ? Arrays.asList(channelId) : null,
null,
getContentSortOrder(),
contentReleaseTime,

View file

@ -441,7 +441,7 @@ public class FollowingFragment extends BaseFragment implements
private List<String> getChannelIds() {
if (channelFilterListAdapter != null) {
Claim selected = channelFilterListAdapter.getSelectedItem();
if (selected != null) {
if (selected != null && !Helper.isNullOrEmpty(selected.getClaimId())) {
return Arrays.asList(selected.getClaimId());
}
}
@ -490,6 +490,11 @@ public class FollowingFragment extends BaseFragment implements
String url = subscription.getUrl();
LbryUri uri = LbryUri.parse(url);
String claimId = uri.getClaimId();
if (Helper.isNullOrEmpty(claimId) || Helper.isNullOrEmpty(url)) {
// don't add null / empty claim IDs or URLs
continue;
}
channelIds.add(claimId);
channelUrls.add(url);
} catch (LbryUriException ex) {