Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 569283002: Fixing a possible NULL pointer dereference in NativeWidgetAura. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index b436c8eeeb13e64bcf76829b8827521254693b5f..b757530e6270939f1a45f4e68790e185bfea04d4 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -860,7 +860,10 @@ void NativeWidgetAura::OnKeyEvent(ui::KeyEvent* event) {
// and the window may be invisible by that time.
if (!window_->IsVisible())
return;
- GetWidget()->GetInputMethod()->DispatchKeyEvent(*event);
+ InputMethod* input_method = GetWidget()->GetInputMethod();
+ if (!input_method)
+ return;
+ input_method->DispatchKeyEvent(*event);
if (switches::IsTextInputFocusManagerEnabled()) {
FocusManager* focus_manager = GetWidget()->GetFocusManager();
delegate_->OnKeyEvent(event);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698