From 62c683fc858a3dcddb13d4134782f83faff00fd9 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 10 Feb 2012 12:56:45 -0800 Subject: [PATCH] Fixed a null pointer exception when setting up the task rabbit control set --- .../todoroo/astrid/activity/TaskEditFragment.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java index 10d6a13f0..dc865ce61 100755 --- a/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskEditFragment.java @@ -517,9 +517,9 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { R.layout.control_set_default_display, R.string.actfm_EPA_assign_label_long, REQUEST_LOG_IN); if(Locale.getDefault().getCountry().equals("US")) { - taskRabbitControl = new TaskRabbitControlSet(this, R.layout.control_set_default_display); - controls.add(taskRabbitControl); - peopleControlSet.addListener(taskRabbitControl); + taskRabbitControl = new TaskRabbitControlSet(this, R.layout.control_set_default_display); + controls.add(taskRabbitControl); + peopleControlSet.addListener(taskRabbitControl); } controls.add(peopleControlSet); controlSetMap.put(getString(R.string.TEA_ctrl_who_pref), @@ -630,8 +630,10 @@ ViewPager.OnPageChangeListener, EditNoteActivity.UpdatesChangedListener { String item = itemOrder[i]; if (item.equals(moreSectionTrigger)) { section = moreControls; - taskRabbitControl.getDisplayView().setVisibility(View.GONE); - section.addView(taskRabbitControl.getDisplayView()); + if (taskRabbitControl != null) { + taskRabbitControl.getDisplayView().setVisibility(View.GONE); + section.addView(taskRabbitControl.getDisplayView()); + } } else { View control_set = null;