Code

Handle case of function call faling. Fixes bug 1501150.
authorjoncruz <joncruz@users.sourceforge.net>
Fri, 9 Jun 2006 07:53:12 +0000 (07:53 +0000)
committerjoncruz <joncruz@users.sourceforge.net>
Fri, 9 Jun 2006 07:53:12 +0000 (07:53 +0000)
ChangeLog
src/widgets/toolbox.cpp

index 55f30adf26c92fc1835973e2db15e480921f2059..213c912bc305d69d15816f7316bdea810dd212ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-09  Jon A. Cruz  <jon@joncruz.org>
+
+       * src/widgets/toolbox.cpp:
+
+         Handle case when function call fails.
+         Fixes bug #1501150.
+
 2006-06-07  Jon A. Cruz  <jon@joncruz.org>
 
        * src/seltrans.cpp:
index cb9557677a058ba52a13ace9144d454ab0748e59..ab480ebeccb9ed838914fabd8ccf94b9a21c48b0 100644 (file)
@@ -2965,16 +2965,19 @@ sp_text_toolbox_family_changed (GtkTreeSelection    *selection,
                                 GObject             *tbl) 
 {
     SPDesktop    *desktop = SP_ACTIVE_DESKTOP;
-    GtkTreeModel *model;
+    GtkTreeModel *model = 0;
     GtkWidget    *popdown = GTK_WIDGET (g_object_get_data (tbl, "family-popdown-window"));
     GtkWidget    *entry = GTK_WIDGET (g_object_get_data (tbl, "family-entry"));
     GtkTreeIter   iter;
-    char         *family;
+    char         *family = 0;
 
     gdk_pointer_ungrab (GDK_CURRENT_TIME);
     gdk_keyboard_ungrab (GDK_CURRENT_TIME);
 
-    gtk_tree_selection_get_selected (selection, &model, &iter);
+    if ( !gtk_tree_selection_get_selected( selection, &model, &iter ) ) {
+        return;
+    }
+
     gtk_tree_model_get (model, &iter, 0, &family, -1);
 
     if (g_object_get_data (G_OBJECT (selection), "block"))