OSDN Git Service

Fix browser crash.
authorPatrick Scott <phanna@android.com>
Fri, 5 Nov 2010 15:09:11 +0000 (11:09 -0400)
committerPatrick Scott <phanna@android.com>
Fri, 5 Nov 2010 15:09:11 +0000 (11:09 -0400)
Also fixed indenting (3 spaces?).

Change-Id: If4a137d1af3ec8a597e8b929e5b4f10240f2f054

WebKit/android/WebCoreSupport/autofill/WebAutoFill.cpp

index f80168d..217bbc0 100644 (file)
@@ -194,13 +194,15 @@ void WebAutoFill::setProfile(int id, const string16& fullName, const string16& e
 
 void WebAutoFill::clearProfiles()
 {
-   // For now Chromium only ever knows about one profile, so we can just
-   // remove it by unique id. If we support multiple profiles in the future
-   // we need to remove them all here.
-   int uniqueProfileId = mAutoFillProfile->unique_id();
-   if (uniqueProfileId != NO_PROFILE_SET)
-       mTabContents->profile()->GetPersonalDataManager()->RemoveProfile(uniqueProfileId);
-   mAutoFillProfile.set(0);
+    if (!mAutoFillProfile)
+        return;
+    // For now Chromium only ever knows about one profile, so we can just
+    // remove it by unique id. If we support multiple profiles in the future
+    // we need to remove them all here.
+    int uniqueProfileId = mAutoFillProfile->unique_id();
+    if (uniqueProfileId != NO_PROFILE_SET)
+        mTabContents->profile()->GetPersonalDataManager()->RemoveProfile(uniqueProfileId);
+    mAutoFillProfile.set(0);
 }
 
 }