Fix crash in many cases
Check whether the QWindow is null Fixes: #37 Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
84ce2eb418
commit
b601d083bf
|
@ -1270,6 +1270,9 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType,
|
|||
return false;
|
||||
}
|
||||
const QWindow *window = getWindowFromRawHandle(msg->hwnd);
|
||||
if (!window) {
|
||||
return false;
|
||||
}
|
||||
const auto data = reinterpret_cast<WINDOWDATA *>(
|
||||
WNEF_EXECUTE_WINAPI_RETURN(GetWindowLongPtrW, 0, msg->hwnd, GWLP_USERDATA));
|
||||
if (!data) {
|
||||
|
|
Loading…
Reference in New Issue