Skip to content

Commit 10d57cb

Browse files
committed
[NTUSER] IntLanguageToggle(): Guard against NULL pFocusQueue (reactos#8368)
Addendum to commit 25b7447 (PR reactos#5839)
1 parent 6a6ed54 commit 10d57cb

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

win32ss/user/ntuser/keyboard.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -821,12 +821,17 @@ IntLanguageToggle(
821821
_In_ BOOL bSameLang,
822822
_In_ INT nKeyState)
823823
{
824-
PWND pWnd = pFocusQueue->spwndFocus;
825-
HWND hWnd;
826-
WPARAM wParam = 0;
824+
PWND pWnd;
827825
PTHREADINFO pti;
828826
PKL pkl;
827+
WPARAM wParam = 0;
829828

829+
if (!pFocusQueue)
830+
{
831+
ERR("IntLanguageToggle(): NULL pFocusQueue\n");
832+
return;
833+
}
834+
pWnd = pFocusQueue->spwndFocus;
830835
if (!pWnd)
831836
pWnd = pFocusQueue->spwndActive;
832837
if (!pWnd)
@@ -843,8 +848,7 @@ IntLanguageToggle(
843848
if (gSystemFS & pkl->dwFontSigs)
844849
wParam |= INPUTLANGCHANGE_SYSCHARSET;
845850

846-
hWnd = UserHMGetHandle(pWnd);
847-
UserPostMessage(hWnd, WM_INPUTLANGCHANGEREQUEST, wParam, (LPARAM)pkl->hkl);
851+
UserPostMessage(UserHMGetHandle(pWnd), WM_INPUTLANGCHANGEREQUEST, wParam, (LPARAM)pkl->hkl);
848852
}
849853

850854
/* Check Language Toggle by [Left Alt]+Shift or Ctrl+Shift */

0 commit comments

Comments
 (0)