From aa75f33e8dc2343df631a0a296e9ef54ea8a88ed Mon Sep 17 00:00:00 2001
From: Mike Massonnet <mmassonnet@xfce.org>
Date: Sun, 15 Jul 2012 17:28:15 +0000
Subject: Fix crash in settings dialog with wrong title alignment value (bug #9108)

---
diff --git a/settings-dialogs/xfwm4-settings.c b/settings-dialogs/xfwm4-settings.c
index 711bce0..212e4e7 100644
--- a/settings-dialogs/xfwm4-settings.c
+++ b/settings-dialogs/xfwm4-settings.c
@@ -1591,17 +1591,19 @@ xfwm_settings_title_button_alignment_changed (GtkComboBox *combo,
   float         align = 0.5f;
 
   model = gtk_combo_box_get_model (combo);
-  gtk_combo_box_get_active_iter (combo, &iter);
-  gtk_tree_model_get (model, &iter, 1, &value, -1);
+  if (gtk_combo_box_get_active_iter (combo, &iter))
+    {
+      gtk_tree_model_get (model, &iter, 1, &value, -1);
 
-  if (g_str_equal (value, "left"))
-    align = 0.0f;
-  else if (g_str_equal (value, "right"))
-    align = 1.0f;
+      if (g_str_equal (value, "left"))
+        align = 0.0f;
+      else if (g_str_equal (value, "right"))
+        align = 1.0f;
 
-  gtk_button_set_alignment (GTK_BUTTON (button), align, 0.5f);
+      g_free (value);
+    }
 
-  g_free (value);
+  gtk_button_set_alignment (GTK_BUTTON (button), align, 0.5f);
 }
 
 
--
cgit v0.9.0.3
 
