[balsa] Possible fix for Red Hat Bugzilla #1462546



commit f1e24b0ea5922a600ce08d485a6d01c63731a1ab
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Jun 19 10:18:11 2017 -0400

    Possible fix for Red Hat Bugzilla #1462546
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1462546, reported by jamesbdonovan rambler ru
    
        * src/balsa-mime-widget-text.c (statusbar_pop): check that the
          main window and the status bar are still valid.

 ChangeLog                    |    7 +++++++
 src/balsa-mime-widget-text.c |   15 +++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 610c3f7..8cad840 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-06-19  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Possible fix for Red Hat Bugzilla #1462546, reported by jamesbdonovan rambler ru
+
+       * src/balsa-mime-widget-text.c (statusbar_pop): check that the
+         main window and the status bar are still valid.
+
 2017-06-18  Albrecht Dreß
 
        Implement automatic sending in background
diff --git a/src/balsa-mime-widget-text.c b/src/balsa-mime-widget-text.c
index 44ba50d..3a3bddb 100644
--- a/src/balsa-mime-widget-text.c
+++ b/src/balsa-mime-widget-text.c
@@ -758,14 +758,17 @@ find_url(GtkWidget * widget, gint x, gint y, GList * url_list)
 static gboolean
 statusbar_pop(gpointer data)
 {
-    GtkStatusbar *statusbar;
-    guint context_id;
-
     gdk_threads_enter();
 
-    statusbar = GTK_STATUSBAR(balsa_app.main_window->statusbar);
-    context_id = gtk_statusbar_get_context_id(statusbar, "BalsaMimeWidget message");
-    gtk_statusbar_pop(statusbar, context_id);
+    if (BALSA_IS_WINDOW(balsa_app.main_window)
+        && GTK_IS_STATUSBAR(balsa_app.main_window->statusbar)) {
+        GtkStatusbar *statusbar;
+        guint context_id;
+
+        statusbar = (GtkStatusbar *) balsa_app.main_window->statusbar;
+        context_id = gtk_statusbar_get_context_id(statusbar, "BalsaMimeWidget message");
+        gtk_statusbar_pop(statusbar, context_id);
+    }
 
     gdk_threads_leave();
     return FALSE;


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