From d5c67a309f740a9a756c979c0dd4453a83889fb2 Mon Sep 17 00:00:00 2001 From: david Date: Mon, 5 Aug 2013 09:07:38 +0200 Subject: [PATCH] Fix app crash --- .../owncloudnewsreader/NewsReaderListFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java b/src/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java index 85563094..2ecf8fc2 100644 --- a/src/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java +++ b/src/de/luhmer/owncloudnewsreader/NewsReaderListFragment.java @@ -35,8 +35,6 @@ import de.luhmer.owncloudnewsreader.reader.IReader; import de.luhmer.owncloudnewsreader.reader.OnAsyncTaskCompletedListener; import de.luhmer.owncloudnewsreader.reader.owncloud.API; import de.luhmer.owncloudnewsreader.reader.owncloud.OwnCloud_Reader; -import de.luhmer.owncloudnewsreader.reader.owncloud.apiv1.APIv1; -import de.luhmer.owncloudnewsreader.reader.owncloud.apiv2.APIv2; /** * A list fragment representing a list of NewsReader. This fragment also @@ -150,7 +148,9 @@ public class NewsReaderListFragment extends SherlockFragment implements OnCreate } private boolean isTwoPaneMode() { - return ((NewsReaderListActivity) getActivity()).ismTwoPane(); + if(getActivity() != null) + return ((NewsReaderListActivity) getActivity()).ismTwoPane(); + return false; } public void StartSync() @@ -322,7 +322,8 @@ public class NewsReaderListFragment extends SherlockFragment implements OnCreate lvAdapter.ReloadAdapter(); NewsReaderListActivity nlActivity = (NewsReaderListActivity) getActivity(); - nlActivity.UpdateItemList(); + if(nlActivity != null) + nlActivity.UpdateItemList(); Log.d(TAG, "onAsyncTask_GetItems Finished");