Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1368)

Unified Diff: components/autofill/content/renderer/form_autofill_util.cc

Issue 531873002: Prospective fix for autofill crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/renderer/form_autofill_util.cc
diff --git a/components/autofill/content/renderer/form_autofill_util.cc b/components/autofill/content/renderer/form_autofill_util.cc
index 29b6009ed5901acb6b66e7c00196586922dea774..fc95527ef537664ce6ade1b123f87ae6875c99e5 100644
--- a/components/autofill/content/renderer/form_autofill_util.cc
+++ b/components/autofill/content/renderer/form_autofill_util.cc
@@ -642,28 +642,28 @@ const size_t kMaxParseableFields = 200;
bool IsMonthInput(const WebInputElement* element) {
CR_DEFINE_STATIC_LOCAL(WebString, kMonth, ("month"));
- return element && element->formControlType() == kMonth;
+ return element && !element->isNull() && element->formControlType() == kMonth;
}
// All text fields, including password fields, should be extracted.
bool IsTextInput(const WebInputElement* element) {
- return element && element->isTextField();
+ return element && !element->isNull() && element->isTextField();
}
bool IsSelectElement(const WebFormControlElement& element) {
// Static for improved performance.
CR_DEFINE_STATIC_LOCAL(WebString, kSelectOne, ("select-one"));
- return element.formControlType() == kSelectOne;
+ return !element.isNull() && element.formControlType() == kSelectOne;
}
bool IsTextAreaElement(const WebFormControlElement& element) {
// Static for improved performance.
CR_DEFINE_STATIC_LOCAL(WebString, kTextArea, ("textarea"));
- return element.formControlType() == kTextArea;
+ return !element.isNull() && element.formControlType() == kTextArea;
}
bool IsCheckableElement(const WebInputElement* element) {
- if (!element)
+ if (!element || element->isNull())
return false;
return element->isCheckbox() || element->isRadioButton();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698