summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2012-11-09 16:00:23 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-11-09 16:00:24 -0800
commit1d3e4209933247ee697421a94fb612198b4003ce (patch)
tree277c9738b3dea0fa39fba3714a614879e12e3fcd /src
parent6011abdc2e0a974a02bc5f21ccc6db3e971be11f (diff)
parent442756084d75d4ebd878e08617a5a4d578589734 (diff)
Merge "Fix NPE if SmartDialLoaderTask has null context"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/dialpad/SmartDialLoaderTask.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/dialer/dialpad/SmartDialLoaderTask.java b/src/com/android/dialer/dialpad/SmartDialLoaderTask.java
index 74f2e5e05..832183785 100644
--- a/src/com/android/dialer/dialpad/SmartDialLoaderTask.java
+++ b/src/com/android/dialer/dialpad/SmartDialLoaderTask.java
@@ -168,14 +168,21 @@ public class SmartDialLoaderTask extends AsyncTask<String, Integer, List<SmartDi
stopWatch.stopAndLog("SmartDial Already Cached", 0);
return;
}
-
+ if (mContext == null) {
+ if (DEBUG) {
+ stopWatch.stopAndLog("Invalid context", 0);
+ }
+ return;
+ }
final Cursor c = mContext.getContentResolver().query(ContactQuery.URI,
(mNameDisplayOrder == ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY)
? ContactQuery.PROJECTION : ContactQuery.PROJECTION_ALTERNATIVE,
ContactQuery.SELECTION, null,
ContactQuery.ORDER_BY);
if (c == null) {
- stopWatch.stopAndLog("Query Failuregi", 0);
+ if (DEBUG) {
+ stopWatch.stopAndLog("Query Failure", 0);
+ }
return;
}
sContactsCache = Lists.newArrayListWithCapacity(c.getCount());