From 7b4981ebb0181c44c3ed004f7389617cae8d2b41 Mon Sep 17 00:00:00 2001 From: "dmazzoni@chromium.org" Date: Thu, 6 May 2010 20:44:09 +0000 Subject: Check for null pointer that can occur when tab is closed quickly after opening. Fixes crash and fixes BrowserKeyEventsTest.ReservedAccelerators. BUG=none TEST=BrowserKeyEventsTest.ReservedAccelerators TBR=sky Review URL: http://codereview.chromium.org/2038002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46615 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/render_widget_host_view_win.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'chrome/browser/renderer_host') diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index f7819e2..34d09b2 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -1496,8 +1496,10 @@ void RenderWidgetHostViewWin::Observe(NotificationType type, RenderProcessHost* render_process_host = Source(source).ptr(); DCHECK(render_process_host); - if (render_process_host != render_widget_host_->process()) + if (render_widget_host_ == NULL || + render_process_host != render_widget_host_->process()) { return; + } // If it was our RenderProcessHost that posted the notification, // clear the BrowserAccessibilityManager, because the renderer is -- cgit v1.1