Sync with trunk r63174.
[reactos.git] / dll / win32 / riched20 / richole.c
index b9e7699..e33bba5 100644 (file)
@@ -503,6 +503,9 @@ ITextDocument_fnGetSelection(ITextDocument* me, ITextSelection** ppSel)
 {
     IRichEditOleImpl *This = impl_from_ITextDocument(me);
     TRACE("(%p)\n", me);
+
+    if(!ppSel)
+      return E_INVALIDARG;
     *ppSel = &This->txtSel->ITextSelection_iface;
     ITextSelection_AddRef(*ppSel);
     return S_OK;
@@ -1502,7 +1505,7 @@ LRESULT CreateIRichEditOle(ME_TextEditor *editor, LPVOID *ppObj)
         return 0;
     }
     reo->clientSite = CreateOleClientSite(reo);
-    if (!reo->txtSel)
+    if (!reo->clientSite)
     {
         ITextSelection_Release(&reo->txtSel->ITextSelection_iface);
         heap_free(reo);