summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/AutofillHandler.java
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2012-02-23 11:18:00 +0000
committerBen Murdoch <benm@google.com>2012-02-23 11:18:00 +0000
commit7458d4cbde2e5e49503d6e87924930d381b7ad89 (patch)
treeb1ae25f8b96a107ffd7d95b180821568277aad60 /src/com/android/browser/AutofillHandler.java
parentd98623751ffc44ab04e75f04cfac87db330bc82b (diff)
downloadandroid_packages_apps_Gello-7458d4cbde2e5e49503d6e87924930d381b7ad89.tar.gz
android_packages_apps_Gello-7458d4cbde2e5e49503d6e87924930d381b7ad89.tar.bz2
android_packages_apps_Gello-7458d4cbde2e5e49503d6e87924930d381b7ad89.zip
Fix NPE when pre-populating Autofill data.
If the user has no me profile, bail out to avoid a NPE. Bug: 5869116 Change-Id: I80701d4563f394879917b6242ace7b2bae584fb2
Diffstat (limited to 'src/com/android/browser/AutofillHandler.java')
-rw-r--r--src/com/android/browser/AutofillHandler.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/browser/AutofillHandler.java b/src/com/android/browser/AutofillHandler.java
index dc23d004..be4fa9c1 100644
--- a/src/com/android/browser/AutofillHandler.java
+++ b/src/com/android/browser/AutofillHandler.java
@@ -158,6 +158,10 @@ public class AutofillHandler {
Cursor c = mContext.getContentResolver().query(uri, new String[] { field },
ContactsContract.Data.MIMETYPE + "=?", new String[] { itemType }, null);
+ if (c == null) {
+ return null;
+ }
+
try {
// Just use the first returned value if we get more than one.
if (c.moveToFirst()) {