win32u: Avoid iterating over a NULL window list when broadcasting.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandros Frantzis 2022-04-11 12:53:50 +03:00 committed by Alexandre Julliard
parent b159edc679
commit 4f705f6f62
1 changed files with 4 additions and 2 deletions

View File

@ -2508,9 +2508,11 @@ static BOOL is_message_broadcastable( UINT msg )
*/
static BOOL broadcast_message( struct send_message_info *info, DWORD_PTR *res_ptr )
{
if (is_message_broadcastable( info->msg ))
HWND *list;
if (is_message_broadcastable( info->msg ) &&
(list = list_window_children( 0, get_desktop_window(), NULL, 0 )))
{
HWND *list = list_window_children( 0, get_desktop_window(), NULL, 0 );
int i;
for (i = 0; list[i]; i++)