diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 666e34b2bcc..27c20970c37 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -524,7 +524,10 @@ static BOOL BrsFolder_OnCommand( browse_info *info, UINT id ) switch (id) { case IDOK: - info->pidlRet = ILClone(info->pidlRet); /* The original pidl will be free'd. */ + /* The original pidl is owned by the treeview and will be free'd. */ + info->pidlRet = ILClone(info->pidlRet); + if (info->pidlRet == NULL) /* A null pidl would mean a cancel */ + info->pidlRet = _ILCreateDesktop(); pdump( info->pidlRet ); if (lpBrowseInfo->pszDisplayName) SHGetPathFromIDListW( info->pidlRet, lpBrowseInfo->pszDisplayName );