From 03f46f4a9d7e77c5ca5bc4d965854598579c07bf Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Tue, 10 Jul 2012 17:42:36 -0700 Subject: [PATCH] Resolve a null pointer in PhoneStateChangedReceiver --- .../com/todoroo/astrid/calls/PhoneStateChangedReceiver.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java b/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java index 0f18ee24d..fa792f111 100644 --- a/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java +++ b/astrid/plugin-src/com/todoroo/astrid/calls/PhoneStateChangedReceiver.java @@ -59,6 +59,8 @@ public class PhoneStateChangedReceiver extends BroadcastReceiver { Calls.DATE + " DESC" ); try { + if (calls == null) + return; if (calls.moveToFirst()) { int numberIndex = calls.getColumnIndex(Calls.NUMBER); String number = calls.getString(numberIndex); @@ -97,7 +99,8 @@ public class PhoneStateChangedReceiver extends BroadcastReceiver { context.startActivity(missedCallIntent); } } finally { - calls.close(); + if (calls != null) + calls.close(); } } }.start();