From: Vadim Zeitlin Date: Sat, 5 Dec 2009 14:25:53 +0000 (+0000) Subject: Don't crash in wxActiveXContainer if FindConnectionPoint() failed. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e5a1bd6409485a5fd2253f945caa2f1fb6ba589c Don't crash in wxActiveXContainer if FindConnectionPoint() failed. This method is supposed to succeed but don't crash by calling Advise() on NULL pointer if it did not. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 73b51d3cac..caf9d7595d 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -1022,11 +1022,14 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) cpContainer->FindConnectionPoint(ta->guid, cp.GetRef()); CHECK_HR(hret); - IDispatch* disp; - m_frameSite->QueryInterface(IID_IDispatch, (void**)&disp); - hret = cp->Advise(new wxActiveXEvents(this, ta->guid), - &adviseCookie); - CHECK_HR(hret); + if ( cp ) + { + IDispatch* disp; + m_frameSite->QueryInterface(IID_IDispatch, (void**)&disp); + hret = cp->Advise(new wxActiveXEvents(this, ta->guid), + &adviseCookie); + CHECK_HR(hret); + } } }