Check for null

This commit is contained in:
Martin Fietz 2017-10-19 20:55:52 +02:00
parent d1eb616800
commit 557d97b450
1 changed files with 3 additions and 0 deletions

View File

@ -116,6 +116,9 @@ public class ItunesSearchFragment extends Fragment {
//Show information about the podcast when the list item is clicked //Show information about the podcast when the list item is clicked
gridView.setOnItemClickListener((parent, view1, position, id) -> { gridView.setOnItemClickListener((parent, view1, position, id) -> {
Podcast podcast = searchResults.get(position); Podcast podcast = searchResults.get(position);
if(podcast.feedUrl == null) {
return;
}
if (!podcast.feedUrl.contains("itunes.apple.com")) { if (!podcast.feedUrl.contains("itunes.apple.com")) {
Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class); Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, podcast.feedUrl); intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, podcast.feedUrl);