From: Robin Dunn Date: Fri, 22 Apr 2005 16:02:04 +0000 (+0000) Subject: Check for potentially NULL m_focus (Patch #1187992) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/dc0846f7450860a9f1fc24701ed754a95311f02f Check for potentially NULL m_focus (Patch #1187992) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 5e6586bb3c..150f81a92c 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -289,9 +289,10 @@ void wxPopupTransientWindow::Popup(wxWindow *winFocus) m_child->Connect(wxEVT_DESTROY, wxWindowDestroyEventHandler(wxPopupTransientWindow::OnDestroy), NULL, this); - m_focus->Connect(wxEVT_DESTROY, - wxWindowDestroyEventHandler(wxPopupTransientWindow::OnDestroy), - NULL, this); + if (m_focus) + m_focus->Connect(wxEVT_DESTROY, + wxWindowDestroyEventHandler(wxPopupTransientWindow::OnDestroy), + NULL, this); } bool wxPopupTransientWindow::Show( bool show )