]> git.saurik.com Git - wxWidgets.git/commitdiff
Check that focused window is non-NULL before using it in wxComboCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 11 Apr 2013 16:54:41 +0000 (16:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 11 Apr 2013 16:54:41 +0000 (16:54 +0000)
wxWindow::FindFocus() may return NULL, don't crash by attempting to
dereference the pointer returned by it.

Closes #15146.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73809 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/combocmn.cpp

index c2f01598e2d0df05a3673d25ec6751f6ec797148..b05554941666542caf7a55aedec0a7f32562dd64 100644 (file)
@@ -389,7 +389,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event )
     wxWindow* popup = m_combo->GetPopupControl()->GetControl();
     wxWindow* winpopup = m_combo->GetPopupWindow();
 
-    if (
+    if ( !winFocused || (
          winFocused != m_focusStart &&
          winFocused != popup &&
          winFocused->GetParent() != popup &&
@@ -398,6 +398,7 @@ void wxComboFrameEventHandler::OnIdle( wxIdleEvent& event )
          winFocused != m_combo &&
          winFocused != m_combo->GetButton() // GTK (atleast) requires this
         )
+       )
     {
         m_combo->HidePopup(true);
     }