[gtk+] Fix a crash on print preview



commit a4db99ff1e26b03e762c4b63b9867ac6e2da6dcd
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sat Dec 19 12:28:46 2009 +0100

    Fix a crash on print preview
    
    There's no printer when doing print preview so it's not possible to get
    its hard margins.

 gtk/gtkprintoperation-unix.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index 4ac60de..f12ab01 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -547,7 +547,7 @@ finish_print (PrintResponseData *rdata,
 
       if (gtk_print_settings_get_number_up (settings) < 2)
         {
-	  if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
+	  if (printer && gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
 	    _gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right);
 	}
       else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]