From 9a84a36f562d9d1511272b85a22a403a824a5727 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Tue, 7 Feb 2012 11:00:31 -0800 Subject: [PATCH] Added a try/catch around an unregisterReceiver call in TLA that would throw a rare exception --- .../src/com/todoroo/astrid/activity/TaskListActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java index 9c12c9834..238740eda 100644 --- a/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java +++ b/astrid/src/com/todoroo/astrid/activity/TaskListActivity.java @@ -307,7 +307,11 @@ public class TaskListActivity extends AstridActivity implements MainMenuListener @Override protected void onStop() { super.onStop(); - unregisterReceiver(tagDeletedReceiver); + try { + unregisterReceiver(tagDeletedReceiver); + } catch (IllegalArgumentException e) { + // Receiver might not be registered if for example activity is stopped before on resume (?) + } } public void setSelectedItem(Filter item) {