From a5ad4971582e46ffc1ffc526af1c7fc87de46266 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Mon, 13 Feb 2017 15:04:03 +0000 Subject: [PATCH] [BROWSEUI] -Fix a couple of cases where the tree view can cause a crash. svn path=/trunk/; revision=73788 --- reactos/dll/win32/browseui/explorerband.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/browseui/explorerband.cpp b/reactos/dll/win32/browseui/explorerband.cpp index 1e9769d7dc0..3ad0758758e 100644 --- a/reactos/dll/win32/browseui/explorerband.cpp +++ b/reactos/dll/win32/browseui/explorerband.cpp @@ -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 {