Index: ui/views/ime/input_method_bridge.cc |
diff --git a/ui/views/ime/input_method_bridge.cc b/ui/views/ime/input_method_bridge.cc |
index 9abb1e2074473d75a9a58db80fa67a72e5e8356f..4a9606d98e04e96d92898150c9e6e7cabc15eebf 100644 |
--- a/ui/views/ime/input_method_bridge.cc |
+++ b/ui/views/ime/input_method_bridge.cc |
@@ -81,7 +81,8 @@ InputMethodBridge::~InputMethodBridge() { |
} |
void InputMethodBridge::OnFocus() { |
- DCHECK(host_); |
+ if (!host_) // |host_| could be NULL after OnInputMethodDestroyed. |
+ return; |
// Direct the shared IME to send TextInputClient messages to |this| object. |
if (shared_input_method_ || !host_->GetTextInputClient()) |
@@ -96,7 +97,8 @@ void InputMethodBridge::OnFocus() { |
} |
void InputMethodBridge::OnBlur() { |
- DCHECK(host_); |
+ if (!host_) // |host_| could be NULL after OnInputMethodDestroyed. |
+ return; |
if (HasCompositionText()) { |
ConfirmCompositionText(); |