Fixed a possible null pointer exception in showListsHelp()

pull/14/head
Sam Bosley 13 years ago
parent 6a6d237a68
commit 9c51674b90

@ -894,12 +894,14 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
return; return;
if (!Preferences.getBoolean( if (!Preferences.getBoolean(
R.string.p_showed_lists_help, false)) { R.string.p_showed_lists_help, false)) {
if (AndroidUtilities.isTabletSized(getActivity())) { AstridActivity activity = (AstridActivity) getActivity();
((AstridActivity) getActivity()).getFilterListFragment().showAddListPopover(); if (activity != null) {
if (AndroidUtilities.isTabletSized(activity)) {
activity.getFilterListFragment().showAddListPopover();
} else { } else {
ActionBar ab = ((AstridActivity) getActivity()).getSupportActionBar(); ActionBar ab = activity.getSupportActionBar();
View anchor = ab.getCustomView().findViewById(R.id.lists_nav); View anchor = ab.getCustomView().findViewById(R.id.lists_nav);
HelpInfoPopover.showPopover(getActivity(), HelpInfoPopover.showPopover(activity,
anchor, R.string.help_popover_switch_lists, null); anchor, R.string.help_popover_switch_lists, null);
} }
Preferences.setBoolean( Preferences.setBoolean(
@ -907,6 +909,7 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
true); true);
} }
} }
}
/* /*
* ====================================================================== * ======================================================================

Loading…
Cancel
Save