forked from AuroraMiddleware/gtk
gtkprintbackendfile: Check the GtkPrintSettings passed to file_printer_get_options is not NULL before using it
https://bugzilla.gnome.org/show_bug.cgi?id=703784
This commit is contained in:
parent
dd6f4fb785
commit
6130f076be
@ -219,7 +219,7 @@ output_file_from_settings (GtkPrintSettings *settings,
|
|||||||
|
|
||||||
if (uri == NULL)
|
if (uri == NULL)
|
||||||
{
|
{
|
||||||
const gchar *extension, *basename, *output_dir;
|
const gchar *extension, *basename = NULL, *output_dir = NULL;
|
||||||
gchar *name, *locale_name, *path;
|
gchar *name, *locale_name, *path;
|
||||||
|
|
||||||
if (default_format)
|
if (default_format)
|
||||||
@ -244,6 +244,7 @@ output_file_from_settings (GtkPrintSettings *settings,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings)
|
||||||
basename = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME);
|
basename = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME);
|
||||||
if (basename == NULL)
|
if (basename == NULL)
|
||||||
basename = _("output");
|
basename = _("output");
|
||||||
@ -255,6 +256,7 @@ output_file_from_settings (GtkPrintSettings *settings,
|
|||||||
|
|
||||||
if (locale_name != NULL)
|
if (locale_name != NULL)
|
||||||
{
|
{
|
||||||
|
if (settings)
|
||||||
output_dir = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_DIR);
|
output_dir = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_DIR);
|
||||||
if (output_dir == NULL)
|
if (output_dir == NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user