[goffice] Do not crash when a chart contains no plot. [#607960]



commit 895c3dbc5bf0aadd49f66a139424eee4e2da4db3
Author: Jean Brefort <jean brefort normalesup org>
Date:   Mon Jan 25 08:26:53 2010 +0100

    Do not crash when a chart contains no plot. [#607960]

 ChangeLog                  |    5 +++++
 NEWS                       |    3 +++
 goffice/canvas/goc-graph.c |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index adaadee..b658f60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-01-25  Jean Brefort  <jean brefort normalesup org>
+
+	* goffice/canvas/goc-graph.c (goc_graph_do_tooltip): do not crash when
+	the chart contains no plot. [#607960]
+
 2010-01-21  Morten Welinder  <terra gnome org>
 
 	* goffice/app/go-plugin.c (go_plugin_read): Add new "autoload"
diff --git a/NEWS b/NEWS
index 6f277bc..4e596e0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.7.19:
 
+Jean:
+	* Do not crash when a chart contains no plot. [#607960]
+
 Morten:
 	* Add "autoload" flag for plugins.
 
diff --git a/goffice/canvas/goc-graph.c b/goffice/canvas/goc-graph.c
index 4808deb..b02e63d 100644
--- a/goffice/canvas/goc-graph.c
+++ b/goffice/canvas/goc-graph.c
@@ -282,8 +282,12 @@ goc_graph_do_tooltip (GocGraph *graph)
 	set = gog_chart_get_axis_set (chart) & GOG_AXIS_SET_FUNDAMENTAL;
 	/* get the plot allocation */
 	l = gog_object_get_children (GOG_OBJECT (chart), gog_object_find_role_by_name (GOG_OBJECT (chart), "Plot"));
+	if (l == NULL)
+		return;
 	view = gog_view_find_child_view (view, GOG_OBJECT (l->data));
 	g_slist_free (l);
+	if (!view)
+		return;
 	alloc = view->allocation;
 	switch (set) {
 	case GOG_AXIS_SET_XY:



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