Added check that Fragment is not null

This commit is contained in:
misaochan 2016-01-26 16:53:31 +13:00
parent 5e500fa653
commit 4f654f3b72

View file

@ -133,6 +133,7 @@ public class CategorizationFragment extends SherlockFragment{
protected void setCatsAfterAsync(ArrayList<String> categories, String filter) {
if (getActivity() != null) {
ArrayList<CategoryItem> items = new ArrayList<CategoryItem>();
HashSet<String> existingKeys = new HashSet<String>();
for (CategoryItem item : categoriesAdapter.getItems()) {
@ -163,6 +164,10 @@ public class CategorizationFragment extends SherlockFragment{
categoriesList.smoothScrollToPosition(existingKeys.size());
}
}
else {
Log.e(TAG, "Error: Fragment is null");
}
}
private class CategoriesAdapter extends BaseAdapter {