diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 7cabef6e9c5..8752f86307a 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -4091,7 +4091,8 @@ TREEVIEW_LButtonDown(TREEVIEW_INFO *infoPtr, LPARAM lParam) InvalidateRect(infoPtr->hwnd, &tempItem->rect, TRUE); /* refresh the selected item to return the filled background */ - InvalidateRect(infoPtr->hwnd, &(infoPtr->selectedItem->rect), TRUE); + if (infoPtr->selectedItem) + InvalidateRect(infoPtr->hwnd, &(infoPtr->selectedItem->rect), TRUE); } return 0;