From 79e40ae8c4d5c3ce5c4baf723356939c83b9236a Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Thu, 18 Jun 2020 17:05:45 +0800 Subject: [PATCH] Fix assert error. Signed-off-by: Yuhang Zhao <2546789017@qq.com> --- winnativeeventfilter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/winnativeeventfilter.cpp b/winnativeeventfilter.cpp index b273936..9161456 100644 --- a/winnativeeventfilter.cpp +++ b/winnativeeventfilter.cpp @@ -964,7 +964,9 @@ bool WinNativeEventFilter::nativeEventFilter(const QByteArray &eventType, // but according to Lucas, frameless applications crashed on many Win7 // machines because it's null. The temporary solution is also strange: // upgrade drivers or switch to the basic theme. - Q_ASSERT(result); + if (!result) { + return false; + } // The example code in Qt's documentation has this check. I don't know // whether we really need this check or not, but adding this check won't // bring us harm anyway.