Fix GLib-GObject-CRITICAL message when printing
authorRicardo Mones <ricardo@mones.org>
Mon, 4 May 2015 01:07:50 +0000 (03:07 +0200)
committerRicardo Mones <ricardo@mones.org>
Mon, 4 May 2015 01:07:50 +0000 (03:07 +0200)
Message was: “g_object_ref: assertion 'G_IS_OBJECT (object)' failed”

src/printing.c

index 064623694d63929b4ae7484b30efe0a60d44eae2..ccd857f20627527c76998da8c959c26965aa3241 100644 (file)
@@ -263,7 +263,7 @@ void printing_print_full(GtkWindow *parent, PrintRenderer *renderer, gpointer re
        print_data->renderer_data = renderer_data;
        print_data->sel_start = sel_start;
        print_data->sel_end = sel_end;
-       print_data->avatar = GTK_IMAGE(g_object_ref(avatar));
+       print_data->avatar = (avatar != NULL? GTK_IMAGE(g_object_ref(avatar)): NULL);
 
        print_data->zoom = 1.;