summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-11-17 14:16:21 +0000
committerBen Murdoch <benm@google.com>2010-11-22 16:02:42 +0000
commite8a28338fcd94ef17506b14fed9ebed7dec1124a (patch)
tree25fec6aaf102914e0d65d8c51d27ab15e0d2e189
parent603f0b890cde1fa23271390895760460e29f85aa (diff)
downloadpackages_apps_Browser-e8a28338fcd94ef17506b14fed9ebed7dec1124a.zip
packages_apps_Browser-e8a28338fcd94ef17506b14fed9ebed7dec1124a.tar.gz
packages_apps_Browser-e8a28338fcd94ef17506b14fed9ebed7dec1124a.tar.bz2
Only delete the current AutoFill profile if one has been set already.
Fix for NPE if the user tries to delete an AutoFill profile before one has been set. Bug: 3198437 Change-Id: I8e836a34f15b52b5dd850778a6dcee466ca91825
-rw-r--r--src/com/android/browser/BrowserSettings.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index 776f4b0..069f886 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -547,8 +547,10 @@ public class BrowserSettings extends Observable {
new SaveProfileToDbTask(ctx, msg).execute(profile);
} else {
// Delete the current profile.
- new DeleteProfileFromDbTask(ctx, msg).execute(autoFillProfile.getUniqueId());
- setActiveAutoFillProfileId(ctx, NO_AUTOFILL_PROFILE_SET);
+ if (autoFillProfile != null) {
+ new DeleteProfileFromDbTask(ctx, msg).execute(autoFillProfile.getUniqueId());
+ setActiveAutoFillProfileId(ctx, NO_AUTOFILL_PROFILE_SET);
+ }
}
autoFillProfile = profile;
}