Skip to content

Commit

Permalink
Omnibox: Fix OnEscapeKeyPressed Crash
Browse files Browse the repository at this point in the history
The associated bug implies a crash on the line
content::WebContents* contents = controller_->GetWebContents();
if (!contents->IsLoading()) {

This crash looks similar to the crash observed in
crbug.com/12250014
where we also assumed that GetWebContents() was non-NULL.

That was fixed by
https://chromiumcodereview.appspot.com/12250014

Peter wrote:
>>>
If we're still getting reports for this crash, then I'd say let's check in and
see if it makes the reports stop.

I'd also like to know if anywhere else assumes a non-NULL WebContents.  If this
makes the crash reports stop, we should fix any other such places too.
>>>

This is one of the other places.

BUG=167510


Review URL: https://chromiumcodereview.appspot.com/12340087

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184845 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mpearson@chromium.org committed Feb 27, 2013
1 parent 58d492e commit d6e0e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chrome/browser/ui/omnibox/omnibox_edit_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ bool OmniboxEditModel::OnEscapeKeyPressed() {
// We do not clear the pending entry from the omnibox when a load is first
// stopped. If the user presses Escape while stopped, we clear it.
content::WebContents* contents = controller_->GetWebContents();
if (!contents->IsLoading()) {
if (contents && !contents->IsLoading()) {
contents->GetController().DiscardNonCommittedEntries();
view_->Update(NULL);
}
Expand Down

0 comments on commit d6e0e0f

Please sign in to comment.