[gnumeric] ssindex: fix crash.



commit 7bdc8697c469987f0013432da568ee5fa74d09d9
Author: Morten Welinder <terra gnome org>
Date:   Thu Mar 4 16:05:05 2010 -0500

    ssindex: fix crash.

 ChangeLog     |    5 +++++
 NEWS          |    1 +
 src/ssindex.c |   20 +++++++++++---------
 3 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6ea86d9..aca3b89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-04  Morten Welinder  <terra gnome org>
+
+	* src/ssindex.c (ssindex_validation): Handle NULLs better.  Fixes
+	#611842.
+
 2010-03-02  Morten Welinder  <terra gnome org>
 
 	* src/graph.c (render_val): For cells, get the right format unless
diff --git a/NEWS b/NEWS
index 7277f6a..51ad85e 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,7 @@ Morten:
 	* Fix solver undo problem.  [#611406]
 	* Fix graph label problem.  [#611362]
 	* Fix GLPK solver issue.  [#611407]
+	* Fix ssindex problem.  [#611842]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.0
diff --git a/src/ssindex.c b/src/ssindex.c
index bba8005..88a4036 100644
--- a/src/ssindex.c
+++ b/src/ssindex.c
@@ -97,15 +97,17 @@ ssindex_hlink (IndexerState *state, GnmHLink const *lnk)
 static void
 ssindex_validation (IndexerState *state, GnmValidation const *valid)
 {
-	gchar const *str;
-
-	str = valid->title->str;
-	if (*str)
-		gsf_xml_out_simple_element (state->output, "data", str);
+	if (valid->title) {
+		const char *str = valid->title->str;
+		if (str && *str)
+			gsf_xml_out_simple_element (state->output, "data", str);
+	}
 
-	str = valid->msg->str;
-	if (*str)
-		gsf_xml_out_simple_element (state->output, "data", str);
+	if (valid->msg) {
+		const char *str = valid->msg->str;
+		if (str && *str)
+			gsf_xml_out_simple_element (state->output, "data", str);
+	}
 }
 
 static void



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