[balsa/wip/gtk4: 240/351] address-view: check for NULL combo-box



commit 9750c67782e58673b7a2c247b0df259448fc8fee
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Mar 22 14:54:20 2018 -0400

    address-view: check for NULL combo-box
    
    If the address-view holds only one type of address, such as Reply To:,
    the child in the combo-box column is NULL.

 libbalsa/address-view.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/libbalsa/address-view.c b/libbalsa/address-view.c
index 0fb166a..617713f 100644
--- a/libbalsa/address-view.c
+++ b/libbalsa/address-view.c
@@ -719,7 +719,7 @@ static void
 lbav_add_from_list(LibBalsaAddressView * address_view,
                    gint row, InternetAddressList * list)
 {
-    gint type;
+    gint type = 0;
     int i;
 
     for (i = 0; i < internet_address_list_length(list); i++) {
@@ -732,7 +732,8 @@ lbav_add_from_list(LibBalsaAddressView * address_view,
 
         if (i == 0) {
             child = lbav_get_combo(address_view, row);
-            type = gtk_combo_box_get_active(GTK_COMBO_BOX(child));
+            if (child != NULL)
+                type = gtk_combo_box_get_active(GTK_COMBO_BOX(child));
 
             child = lbav_get_button(address_view, row);
             gtk_widget_destroy(child);


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