[gedit: 4/4] tab: make print_cancelled() a bit more robust



commit 5949162d3ccc258b6f13b153e3447e9260d4c181
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Feb 19 20:50:00 2015 +0100

    tab: make print_cancelled() a bit more robust
    
    The info bar has nothing to do with the print_cancelled().

 gedit/gedit-tab.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index c1830e0..ec7b963 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -2860,11 +2860,12 @@ print_cancelled (GtkWidget *bar,
                 gint       response_id,
                 GeditTab  *tab)
 {
-       g_return_if_fail (GEDIT_IS_PROGRESS_INFO_BAR (tab->priv->info_bar));
-
-       gedit_print_job_cancel (tab->priv->print_job);
+       gedit_debug (DEBUG_TAB);
 
-       g_debug ("print_cancelled");
+       if (tab->priv->print_job != NULL)
+       {
+               gedit_print_job_cancel (tab->priv->print_job);
+       }
 }
 
 static void


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