Cups: Check the created QPrintDevice is valid before using it

Task-number: QTBUG-63293
Change-Id: Ibde0e8db955f6f3647b31cef8561d0744754cec1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Andy Shaw 2017-09-25 11:28:20 +02:00 committed by Jani Heikkinen
parent b4e9cb4c29
commit 2b51ad4712

View File

@ -293,7 +293,7 @@ void QCupsPrintEnginePrivate::changePrinter(const QString &newPrinter)
// Try create the printer, only use it if it returns valid
QPrintDevice printDevice = ps->createPrintDevice(newPrinter);
if (!m_printDevice.isValid())
if (!printDevice.isValid())
return;
m_printDevice.swap(printDevice);
printerName = m_printDevice.id();