From 1e5deeb2f17f90a09c0ba881e91db6ee2bad87e0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 8 Mar 2006 00:03:15 +0000 Subject: [PATCH] don't crash in case of incorrectly specified parent type of MDI child frame (coverity checker CID 16) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37890 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/xrc/xh_mdi.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xrc/xh_mdi.cpp b/src/xrc/xh_mdi.cpp index 5838d7c288..507f49d806 100644 --- a/src/xrc/xh_mdi.cpp +++ b/src/xrc/xh_mdi.cpp @@ -78,7 +78,10 @@ wxWindow *wxMdiXmlHandler::CreateFrame() wxMDIParentFrame *mdiParent = wxDynamicCast(m_parent, wxMDIParentFrame); if ( !mdiParent ) - wxLogError(wxT("Parent is not of type wxMDIParentFrame.")); + { + wxLogError(wxT("Parent of wxMDIParentFrame must be wxMDIParentFrame.")); + return NULL; + } XRC_MAKE_INSTANCE(frame, wxMDIChildFrame); -- 2.45.2