Commit 279677b7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/treeview: Fix possible crash in TVS_SINGELEXPAND helper (Coverity).

parent c678bdd7
......@@ -1255,6 +1255,13 @@ static void test_TVS_SINGLEEXPAND(void)
ok(ret, "got %d\n", ret);
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_singleexpand_seq, "singleexpand notifications", FALSE);
/* a workaround for NT4 that sends expanding notification when nothing is about to expand */
ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hRoot);
ok(ret, "got %d\n", ret);
fill_tree(hTree);
ret = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0);
ok(ret, "got %d\n", ret);
DestroyWindow(hTree);
}
......
......@@ -3426,7 +3426,7 @@ static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr,
{
TREEVIEW_ITEM *SelItem;
if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit) return;
if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return;
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment