Index: chrome/browser/automation/testing_automation_provider.cc |
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc |
index 11b906360478fba8cfdde3b7577fca1b8c3f7d05..9b5edb289baf385b761d3586e658c3e520ba9242 100644 |
--- a/chrome/browser/automation/testing_automation_provider.cc |
+++ b/chrome/browser/automation/testing_automation_provider.cc |
@@ -3606,7 +3606,10 @@ void TestingAutomationProvider::RemoveSavedPassword( |
// Use EXPLICIT_ACCESS since passwords can be removed in incognito mode. |
PasswordStore* password_store = |
profile->GetPasswordStore(Profile::EXPLICIT_ACCESS); |
- |
+ if (password_store == NULL) { |
+ reply.SendError("Unable to get password store."); |
James Hawkins
2011/05/20 22:28:18
This is likely more useful as LOG(ERROR), here and
|
+ return; |
+ } |
password_store->RemoveLogin(to_remove); |
reply.SendSuccess(NULL); |
} |
@@ -3623,6 +3626,11 @@ void TestingAutomationProvider::GetSavedPasswords( |
// incognito mode. |
PasswordStore* password_store = |
profile->GetPasswordStore(Profile::EXPLICIT_ACCESS); |
+ if (password_store == NULL) { |
+ AutomationJSONReply reply(this, reply_message); |
+ reply.SendError("Unable to get password store."); |
+ return; |
+ } |
password_store->GetAutofillableLogins( |
new AutomationProviderGetPasswordsObserver(this, reply_message)); |
// Observer deletes itself after returning. |