From 02abda4be818fda88485193b6a51338258fb6714 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 16 Jun 2016 09:26:32 -0700 Subject: [PATCH] Use isKindOfClass --- atom/browser/common_web_contents_delegate_mac.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/atom/browser/common_web_contents_delegate_mac.mm b/atom/browser/common_web_contents_delegate_mac.mm index eeb87f2665..f473c14062 100644 --- a/atom/browser/common_web_contents_delegate_mac.mm +++ b/atom/browser/common_web_contents_delegate_mac.mm @@ -23,8 +23,9 @@ void CommonWebContentsDelegate::HandleKeyboardEvent( if (event.windowsKeyCode == ui::VKEY_ESCAPE && is_html_fullscreen()) ExitFullscreenModeForTab(source); - if (event.os_event.window) { - AtomNSWindow* native_window = static_cast(event.os_event.window); + NSWindow* window = event.os_event.window; + if (window && [window isKindOfClass:[AtomNSWindow class]]) { + AtomNSWindow* native_window = static_cast(window); [native_window redispatchKeyEvent:event.os_event]; } }