Bug 1699343: Adjust nsPrinterListWin::SystemDefaultPrinterName to make it infallible, like its CUPS-backed eqivalent. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D109172
This commit is contained in:
Daniel Holbert 2021-03-20 04:41:58 +00:00
Родитель 5e567c27f5
Коммит 236fbd8307
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -590,10 +590,11 @@ RefPtr<nsIPrinter> nsPrinterListWin::CreatePrinter(PrinterInfo aInfo) const {
}
nsresult nsPrinterListWin::SystemDefaultPrinterName(nsAString& aName) const {
if (GetDefaultPrinterName(aName)) {
return NS_OK;
if (!GetDefaultPrinterName(aName)) {
NS_WARNING("Uh oh, GetDefaultPrinterName failed");
// Indicate failure by leaving aName untouched, i.e. the empty string.
}
return NS_ERROR_NOT_AVAILABLE;
return NS_OK;
}
NS_IMETHODIMP