[gtkhtml] Bug #690029 - Crash on edit of an empty HTML signature



commit 287970c170dcc09dd957f63f6bbb6a44c3cda03e
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jan 11 13:43:05 2013 +0100

    Bug #690029 - Crash on edit of an empty HTML signature
    
    Just a workaround, to not insert HTML code which leads to empty text.

 gtkhtml/gtkhtml.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtkhtml/gtkhtml.c b/gtkhtml/gtkhtml.c
index ec30a76..8a14e10 100644
--- a/gtkhtml/gtkhtml.c
+++ b/gtkhtml/gtkhtml.c
@@ -6339,10 +6339,13 @@ gtk_html_insert_html_generic (GtkHTML *html,
 		g_return_if_fail (tmp->engine->clue);
 
 		o = tmp->engine->clue;
-		tmp->engine->clue = NULL;
-		html_engine_insert_object (html->engine, o,
-					   html_object_get_recursive_length (o),
-					   html_engine_get_insert_level_for_object (html->engine, o));
+		/* skip empty HTML */
+		if (html_object_get_recursive_length (o) > 0) {
+			tmp->engine->clue = NULL;
+			html_engine_insert_object (html->engine, o,
+						   html_object_get_recursive_length (o),
+						   html_engine_get_insert_level_for_object (html->engine, o));
+		}
 	}
 	gtk_widget_destroy (window);
 	html_engine_thaw (html->engine);



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