Fix gtkprintbackendcups crash

From trying to call g_list_delete_link with a NULL node or
removed_printer_checklist.
This commit is contained in:
John Ralls
2013-03-01 10:13:20 -08:00
parent c7cf937789
commit 54ffc982e9

View File

@@ -2067,11 +2067,15 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
} }
/* remove name from checklist if it was found */ /* remove name from checklist if it was found */
node = g_list_find_custom (removed_printer_checklist, if (removed_printer_checklist != NULL)
info->printer_name, {
(GCompareFunc) find_printer); if (node = g_list_find_custom (removed_printer_checklist,
removed_printer_checklist = g_list_delete_link (removed_printer_checklist, info->printer_name,
node); (GCompareFunc) find_printer))
removed_printer_checklist =
g_list_delete_link (removed_printer_checklist,
node);
}
printer = gtk_print_backend_find_printer (backend, info->printer_name); printer = gtk_print_backend_find_printer (backend, info->printer_name);
if (!printer) if (!printer)