Commit f85180e5 authored by Changwan Ryu's avatar Changwan Ryu Committed by Commit Bot

Fix crashes in autofill_agent

element_ can be null, so adding IsNull() checks to prevent crashes.

Bug: 862044

Change-Id: Ibcbf445684b6f221729e7a6f4259c84ed8ed8127
Reviewed-on: https://chromium-review.googlesource.com/1169435
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Reviewed-by: default avatarSebastien Seguin-Gagnon <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582055}
parent 2472878c
...@@ -194,6 +194,9 @@ void AutofillAgent::DidFinishDocumentLoad() { ...@@ -194,6 +194,9 @@ void AutofillAgent::DidFinishDocumentLoad() {
} }
void AutofillAgent::DidChangeScrollOffset() { void AutofillAgent::DidChangeScrollOffset() {
if (element_.IsNull())
return;
if (!focus_requires_scroll_) { if (!focus_requires_scroll_) {
// Post a task here since scroll offset may change during layout. // Post a task here since scroll offset may change during layout.
// (https://crbug.com/804886) // (https://crbug.com/804886)
...@@ -210,7 +213,7 @@ void AutofillAgent::DidChangeScrollOffset() { ...@@ -210,7 +213,7 @@ void AutofillAgent::DidChangeScrollOffset() {
void AutofillAgent::DidChangeScrollOffsetImpl( void AutofillAgent::DidChangeScrollOffsetImpl(
const WebFormControlElement& element) { const WebFormControlElement& element) {
if (element != element_ || focus_requires_scroll_ || if (element != element_ || element_.IsNull() || focus_requires_scroll_ ||
!is_popup_possibly_visible_ || !element_.Focused()) !is_popup_possibly_visible_ || !element_.Focused())
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment