Fix crash that occurs when closing application window while invetory is displayed.

This commit is contained in:
Bart House
2017-09-02 14:12:32 -07:00
committed by Pasi Kallinen
parent 497a0b47c8
commit be4e0992e6

View File

@@ -884,6 +884,11 @@ GetMenuControl(HWND hWnd)
data = (PNHMenuWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
/* We may continue getting window messages after a window's WM_DESTROY is
called. We need to handle the case that USERDATA has been freed. */
if (data == NULL)
return NULL;
if (data->type == MENU_TYPE_TEXT) {
return GetDlgItem(hWnd, IDC_MENU_TEXT);
} else {