Don't allow null prefs in onSortSelected

pull/14/head
Sam Bosley 12 years ago
parent 2e36704124
commit a75659f3a0

@ -1344,11 +1344,15 @@ public class TaskListFragment extends ListFragment implements OnScrollListener,
if (always) { if (always) {
SharedPreferences publicPrefs = AstridPreferences.getPublicPrefs(ContextManager.getContext()); SharedPreferences publicPrefs = AstridPreferences.getPublicPrefs(ContextManager.getContext());
Editor editor = publicPrefs.edit(); if (publicPrefs != null) {
editor.putInt(SortHelper.PREF_SORT_FLAGS, flags); Editor editor = publicPrefs.edit();
editor.putInt(SortHelper.PREF_SORT_SORT, sort); if (editor != null) {
editor.commit(); editor.putInt(SortHelper.PREF_SORT_FLAGS, flags);
TasksWidget.updateWidgets(ContextManager.getContext()); editor.putInt(SortHelper.PREF_SORT_SORT, sort);
editor.commit();
TasksWidget.updateWidgets(ContextManager.getContext());
}
}
} }
try { try {

Loading…
Cancel
Save