diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index bf5e73f002..7fd3f4fcc1 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -773,6 +773,8 @@ void QWindowsIntegration::setApplicationBadge(const QImage &image) // the other windows will take over in showing the badge. const auto topLevelWindows = QGuiApplication::topLevelWindows(); for (auto *topLevelWindow : topLevelWindows) { + if (!topLevelWindow->handle()) + continue; auto hwnd = reinterpret_cast(topLevelWindow->winId()); taskbarList->SetOverlayIcon(hwnd, hIcon, L""); }