user: Fix dereferencing a potential NULL pointer.

This commit is contained in:
Rein Klazes 2006-04-08 12:48:13 +02:00 committed by Alexandre Julliard
parent 5f4b424553
commit 7a560493fe
1 changed files with 16 additions and 16 deletions

View File

@ -1693,23 +1693,23 @@ static void MENU_DrawPopupMenu( HWND hwnd, HDC hdc, HMENU hmenu )
else else
DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT); DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT);
menu = MENU_GetMenu( hmenu ); if( (menu = MENU_GetMenu( hmenu )))
{
/* draw menu items */ /* draw menu items */
if (menu && menu->nItems) if( menu->nItems)
{ {
MENUITEM *item; MENUITEM *item;
UINT u; UINT u;
for (u = menu->nItems, item = menu->items; u > 0; u--, item++) item = menu->items;
MENU_DrawMenuItem( hwnd, hmenu, menu->hwndOwner, hdc, item, for( u = menu->nItems; u > 0; u--, item++)
menu->Height, FALSE, ODA_DRAWENTIRE ); MENU_DrawMenuItem( hwnd, hmenu, menu->hwndOwner, hdc,
item, menu->Height, FALSE, ODA_DRAWENTIRE );
} }
/* draw scroll arrows */
/* draw scroll arrows */ if (menu->bScrolling)
if (menu->bScrolling) MENU_DrawScrollArrows(menu, hdc);
MENU_DrawScrollArrows(menu, hdc); }
} else } else
{ {
SelectObject( hdc, hPrevBrush ); SelectObject( hdc, hPrevBrush );