зеркало из https://github.com/mozilla/pjs.git
Bug 452438 - Null-check stored printer-name string before passing it to nsTSubstring::Equals(), to avoid triggering an assertion. r+sr=roc
This commit is contained in:
Родитель
3475ec9eab
Коммит
7ee9f18094
|
@ -491,7 +491,12 @@ nsPrintSettingsGTK::SetPrinterName(const PRUnichar * aPrinter)
|
|||
gtkPrinter.Cut(0, strlen("CUPS/"));
|
||||
}
|
||||
|
||||
if (!gtkPrinter.Equals(gtk_print_settings_get_printer(mPrintSettings))) {
|
||||
// Give mPrintSettings the passed-in printer name if either...
|
||||
// - it has no printer name stored yet
|
||||
// - it has an existing printer name that's different from
|
||||
// the name passed to this function.
|
||||
const char* oldPrinterName = gtk_print_settings_get_printer(mPrintSettings);
|
||||
if (!oldPrinterName || !gtkPrinter.Equals(oldPrinterName)) {
|
||||
mIsInitedFromPrinter = PR_FALSE;
|
||||
mIsInitedFromPrefs = PR_FALSE;
|
||||
gtk_print_settings_set_printer(mPrintSettings, gtkPrinter.get());
|
||||
|
|
Загрузка…
Ссылка в новой задаче