diff --git a/src/printsupport/platform/windows/qwindowsprintdevice.cpp b/src/printsupport/platform/windows/qwindowsprintdevice.cpp index a6aa9c6504a..faf491d9a90 100644 --- a/src/printsupport/platform/windows/qwindowsprintdevice.cpp +++ b/src/printsupport/platform/windows/qwindowsprintdevice.cpp @@ -499,7 +499,7 @@ QStringList QWindowsPrintDevice::availablePrintDeviceIds() QString QWindowsPrintDevice::defaultPrintDeviceId() { DWORD size = 0; - if (GetDefaultPrinter(nullptr, &size) == ERROR_FILE_NOT_FOUND) + if (GetDefaultPrinter(nullptr, &size) == ERROR_FILE_NOT_FOUND || size < 2) return QString(); QScopedArrayPointer name(new wchar_t[size]);