https://git.reactos.org/?p=reactos.git;a=commitdiff;h=058c2658a43a2ea2f155b…
commit 058c2658a43a2ea2f155be0c8b7ecf97c2ae18d3
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Mon Feb 5 17:12:00 2018 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Mon Feb 5 17:39:32 2018 +0100
[SHELL32] CDefViewBckgrndMenu: Fix a crash when pasting on a new explorer window.
---
dll/win32/shell32/CDefViewBckgrndMenu.cpp | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shell32/CDefViewBckgrndMenu.cpp
b/dll/win32/shell32/CDefViewBckgrndMenu.cpp
index 281366ac26..2fc6f1ac02 100644
--- a/dll/win32/shell32/CDefViewBckgrndMenu.cpp
+++ b/dll/win32/shell32/CDefViewBckgrndMenu.cpp
@@ -210,7 +210,12 @@ CDefViewBckgrndMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
UINT idCmd = LOWORD(lpcmi->lpVerb);
if(HIWORD(lpcmi->lpVerb) != 0 || idCmd < m_LastFolderCMId)
{
- return m_folderCM->InvokeCommand(lpcmi);
+ if (m_folderCM)
+ {
+ return m_folderCM->InvokeCommand(lpcmi);
+ }
+ WARN("m_folderCM is NULL!\n");
+ return E_NOTIMPL;
}
/* The default part of the background menu doesn't have shifted ids so we need to
convert the id offset to the real id */
@@ -221,8 +226,13 @@ CDefViewBckgrndMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpcmi)
{
case FCIDM_SHVIEW_INSERT:
case FCIDM_SHVIEW_INSERTLINK:
- lpcmi->lpVerb = MAKEINTRESOURCEA(idCmd);
- return m_folderCM->InvokeCommand(lpcmi);
+ if (m_folderCM)
+ {
+ lpcmi->lpVerb = MAKEINTRESOURCEA(idCmd);
+ return m_folderCM->InvokeCommand(lpcmi);
+ }
+ WARN("m_folderCM is NULL!\n");
+ return E_NOTIMPL;
case FCIDM_SHVIEW_BIGICON:
case FCIDM_SHVIEW_SMALLICON:
case FCIDM_SHVIEW_LISTVIEW: