diff --git a/atom/browser/common_web_contents_delegate_mac.mm b/atom/browser/common_web_contents_delegate_mac.mm index 39ba3cf141..e285c321e2 100644 --- a/atom/browser/common_web_contents_delegate_mac.mm +++ b/atom/browser/common_web_contents_delegate_mac.mm @@ -23,11 +23,8 @@ void CommonWebContentsDelegate::HandleKeyboardEvent( if (event.windowsKeyCode == ui::VKEY_ESCAPE && is_html_fullscreen()) ExitFullscreenModeForTab(source); - NSWindow* window = event.os_event.window; - if (window && [window isKindOfClass:[EventDispatchingWindow class]]) { - EventDispatchingWindow* native_window = static_cast(window); - [native_window redispatchKeyEvent:event.os_event]; - } + EventDispatchingWindow* native_window = static_cast(event.os_event.window); + [native_window redispatchKeyEvent:event.os_event]; } } // namespace atom