Index: chrome/browser/renderer_host/render_widget_host_view_views.cc |
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc |
index 12bf25fb687f7c1ad98c71a42cdb4b1149db17af..65346ac33b642f97e7a87853201028dfe17648b3 100644 |
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc |
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc |
@@ -271,14 +271,21 @@ void RenderWidgetHostViewViews::ImeUpdateTextInputState( |
// as true. We need to support "can_compose_inline=false" for PPAPI plugins |
// that may want to avoid drawing composition-text by themselves and pass |
// the responsibility to the browser. |
- DCHECK(GetInputMethod()); |
+ |
+ // This is async message and by the time the ipc arrived, |
+ // RWHVV may be detached from Top level widget, in which case |
+ // GetInputMethod may return NULL; |
+ views::InputMethod* input_method = GetInputMethod(); |
+ |
if (text_input_type_ != type) { |
text_input_type_ = type; |
- GetInputMethod()->OnTextInputTypeChanged(this); |
+ if (input_method) |
+ input_method->OnTextInputTypeChanged(this); |
} |
if (caret_bounds_ != caret_rect) { |
caret_bounds_ = caret_rect; |
- GetInputMethod()->OnCaretBoundsChanged(this); |
+ if (input_method) |
+ input_method->OnCaretBoundsChanged(this); |
} |
} |