[gtk+/gtk-3-8] gtkprintbackendfile: Check the GtkPrintSettings passed to file_printer_get_options is not NULL befor
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-8] gtkprintbackendfile: Check the GtkPrintSettings passed to file_printer_get_options is not NULL befor
- Date: Thu, 21 Nov 2013 02:08:30 +0000 (UTC)
commit 29d6eec09ae5f7ad32782b7e3c567eb181fc4697
Author: Carlos Garcia Campos <cgarcia igalia com>
Date: Fri Nov 8 15:42:15 2013 +0100
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
modules/printbackends/file/gtkprintbackendfile.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/modules/printbackends/file/gtkprintbackendfile.c
b/modules/printbackends/file/gtkprintbackendfile.c
index 9fe2d78..ff850f1 100644
--- a/modules/printbackends/file/gtkprintbackendfile.c
+++ b/modules/printbackends/file/gtkprintbackendfile.c
@@ -219,7 +219,7 @@ output_file_from_settings (GtkPrintSettings *settings,
if (uri == NULL)
{
- const gchar *extension, *basename, *output_dir;
+ const gchar *extension, *basename = NULL, *output_dir = NULL;
gchar *name, *locale_name, *path;
if (default_format)
@@ -244,7 +244,8 @@ output_file_from_settings (GtkPrintSettings *settings,
}
}
- basename = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME);
+ if (settings)
+ basename = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_BASENAME);
if (basename == NULL)
basename = _("output");
@@ -254,8 +255,9 @@ output_file_from_settings (GtkPrintSettings *settings,
g_free (name);
if (locale_name != NULL)
- {
- output_dir = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_DIR);
+ {
+ if (settings)
+ output_dir = gtk_print_settings_get (settings, GTK_PRINT_SETTINGS_OUTPUT_DIR);
if (output_dir == NULL)
{
const gchar *document_dir = g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]