]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't crash in wxActiveXContainer if FindConnectionPoint() failed.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Dec 2009 14:25:53 +0000 (14:25 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 5 Dec 2009 14:25:53 +0000 (14:25 +0000)
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

src/msw/ole/activex.cpp

index 73b51d3cacd64958b4ffb6efda45def9fe652718..caf9d7595d49f05915f92d364cb518310eb28308 100644 (file)
@@ -1022,11 +1022,14 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
                     cpContainer->FindConnectionPoint(ta->guid, cp.GetRef());
                 CHECK_HR(hret);
 
                     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);
+                }
             }
         }
 
             }
         }