diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-15 21:29:14 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-15 21:29:14 +0200 |
commit | c2a5f583e9bf885258df95b8b58d35fa9162d697 (patch) | |
tree | a264c04b3fa7b37e50cfe65a9fb05fdf85e4c0c7 /src/de/danoeh | |
parent | f42746555ec5d4434c7e2484bd8dd26aa09e4b65 (diff) | |
download | AntennaPod-c2a5f583e9bf885258df95b8b58d35fa9162d697.zip |
Fixed nullpointerexception caused by FeedlistFragment
Diffstat (limited to 'src/de/danoeh')
-rw-r--r-- | src/de/danoeh/antennapod/fragment/FeedlistFragment.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java index 19a14299e..0e06e546e 100644 --- a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.fragment; import java.util.List; import android.annotation.SuppressLint; +import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; @@ -29,9 +30,9 @@ import de.danoeh.antennapod.storage.FeedItemStatistics; import de.danoeh.antennapod.util.menuhandler.FeedMenuHandler; public class FeedlistFragment extends Fragment implements - ActionMode.Callback, AdapterView.OnItemClickListener, - AdapterView.OnItemLongClickListener { - private static final String TAG = "FeedlistFragment"; + ActionMode.Callback, AdapterView.OnItemClickListener, + AdapterView.OnItemLongClickListener { + private static final String TAG = "FeedlistFragment"; private static final int EVENTS = EventDistributor.DOWNLOAD_HANDLED | EventDistributor.DOWNLOAD_QUEUED @@ -94,12 +95,16 @@ public class FeedlistFragment extends Fragment implements AsyncTask<Void, Void, List[]> loadTask = new AsyncTask<Void, Void, List[]>() { @Override protected List[] doInBackground(Void... params) { - return new List[]{DBReader.getFeedList(getActivity()), - DBReader.getFeedStatisticsList(getActivity())}; + Context context = getActivity(); + if (context != null) { + return new List[]{DBReader.getFeedList(context), + DBReader.getFeedStatisticsList(context)}; + } else { + return null; + } } - @Override protected void onPostExecute(List[] result) { super.onPostExecute(result); |