From bfd5b31a0e57c6e29cdb55e351ba9da40caa670f Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Thu, 25 May 2000 23:00:46 +0000 Subject: [PATCH] Fixes crash when calling Treeview_EndEditLabelNow and no node is currently edited. --- dlls/comctl32/treeview.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index e10549c741b..23517a642d7 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -3116,7 +3116,7 @@ TREEVIEW_EndEditLabelNow (HWND hwnd, WPARAM wParam, LPARAM lParam) else if( newText!=NULL ) { /* - ** Is really this necasery? shouldnt an app update its internal data in TVN_ENDLABELEDITA? + ** Is really this necessary? shouldnt an app update its internal data in TVN_ENDLABELEDITA? */ if( !bRevert ) { @@ -3910,10 +3910,11 @@ TREEVIEW_SetScrollTime (HWND hwnd, UINT uScrollTime) static LRESULT WINAPI TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { + TREEVIEW_INFO *infoPtr; if (uMsg==WM_CREATE) return TREEVIEW_Create (hwnd, wParam, lParam); - if (!TREEVIEW_GetInfoPtr(hwnd)) + if (!(infoPtr = TREEVIEW_GetInfoPtr(hwnd))) return DefWindowProcA (hwnd, uMsg, wParam, lParam); switch (uMsg) { @@ -3998,7 +3999,8 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return TREEVIEW_SortChildrenCB(hwnd, wParam, lParam); case TVM_ENDEDITLABELNOW: - return TREEVIEW_EndEditLabelNow (hwnd, wParam, lParam); + if (infoPtr->editItem) + return TREEVIEW_EndEditLabelNow (hwnd, wParam, lParam); case TVM_GETISEARCHSTRINGA: FIXME("Unimplemented msg TVM_GETISEARCHSTRINGA\n");