[balsa] Do not print header line with NULL address string



commit a4ed5bba63bfafc32aaf63cd3097016f81cf5e57
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Aug 11 11:07:31 2009 -0400

    Do not print header line with NULL address string

 ChangeLog                       |    5 +++++
 src/balsa-print-object-header.c |    7 ++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fce5c0b..89463dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-11  Peter Bloomfield
+
+	* src/balsa-print-object-header.c (header_add_list): do not
+	print header line with NULL address string.
+
 2006-08-09  Pawel Salek
 
 	* NEWS, configure.in: release balsa-2.4.1
diff --git a/src/balsa-print-object-header.c b/src/balsa-print-object-header.c
index 2aac105..062cea8 100644
--- a/src/balsa-print-object-header.c
+++ b/src/balsa-print-object-header.c
@@ -520,16 +520,17 @@ header_add_list(PangoLayout * layout, GString * header_buf,
     gchar *_value;
     gint p_width;
 
-    if (!values || balsa_app.shown_headers == HEADERS_NONE ||
+    if (balsa_app.shown_headers == HEADERS_NONE ||
 	!(balsa_app.show_all_headers ||
 	  balsa_app.shown_headers == HEADERS_ALL ||
-	  libbalsa_find_word(field_id, balsa_app.selected_headers)))
+	  libbalsa_find_word(field_id, balsa_app.selected_headers)) ||
+        !values ||
+        !(_value = internet_address_list_to_string(values, FALSE)))
 	return;
 
     p_width = p_string_width_from_layout(layout, label);
     if (p_width > *p_label_width)
 	*p_label_width = p_width;
-    _value = internet_address_list_to_string(values, FALSE);
     libbalsa_utf8_sanitize(&_value, balsa_app.convert_unknown_8bit, NULL);
     g_string_append_printf(header_buf, "%s\t%s\n", label, _value);
     g_free(_value);



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