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 cb7947514250d5bbe3f689711c7590b9da959a29..139b0e3e3dc38bdf61fc371f19972b1ea1a157b4 100644 |
--- a/components/autofill/content/renderer/form_autofill_util.cc |
+++ b/components/autofill/content/renderer/form_autofill_util.cc |
@@ -893,6 +893,10 @@ void FillFormField(const FormFieldData& data, |
} |
field->setValue(value, true); |
} |
+ // Setting the form might trigger JavaScript, which is capable of |
+ // destroying the frame. |
+ if (!field->document().frame()) |
+ return; |
field->setAutofilled(true); |