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:
parent
b4e9cb4c29
commit
2b51ad4712
@ -293,7 +293,7 @@ void QCupsPrintEnginePrivate::changePrinter(const QString &newPrinter)
|
|||||||
|
|
||||||
// Try create the printer, only use it if it returns valid
|
// Try create the printer, only use it if it returns valid
|
||||||
QPrintDevice printDevice = ps->createPrintDevice(newPrinter);
|
QPrintDevice printDevice = ps->createPrintDevice(newPrinter);
|
||||||
if (!m_printDevice.isValid())
|
if (!printDevice.isValid())
|
||||||
return;
|
return;
|
||||||
m_printDevice.swap(printDevice);
|
m_printDevice.swap(printDevice);
|
||||||
printerName = m_printDevice.id();
|
printerName = m_printDevice.id();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user