[BROWSEUI] -Fix a couple of cases where the tree view can cause a crash.
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 13 Feb 2017 15:04:03 +0000 (15:04 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Mon, 13 Feb 2017 15:04:03 +0000 (15:04 +0000)
svn path=/trunk/; revision=73788

reactos/dll/win32/browseui/explorerband.cpp

index 1e9769d..3ad0758 100644 (file)
@@ -358,10 +358,12 @@ BOOL CExplorerBand::OnTreeItemDeleted(LPNMTREEVIEW pnmtv)
 {
     /* Destroy memory associated to our node */
     NodeInfo* ptr = GetNodeInfo(pnmtv->itemNew.hItem);
-
-    ILFree(ptr->relativePidl);
-    ILFree(ptr->absolutePidl);
-    delete ptr;
+    if (ptr)
+    {    
+        ILFree(ptr->relativePidl);
+        ILFree(ptr->absolutePidl);
+        delete ptr;
+    }
     return TRUE;
 }
 
@@ -1511,7 +1513,10 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::DragOver(DWORD glfKeyState, POINTL pt,
             hr = pDropTarget->DragEnter(pCurObject, glfKeyState, pt, pdwEffect);
             childTargetNode = info.hItem;
         }
-        hr = pDropTarget->DragOver(glfKeyState, pt, pdwEffect);
+        if (pDropTarget)
+        {
+            hr = pDropTarget->DragOver(glfKeyState, pt, pdwEffect);
+        }
     }
     else
     {