[gnome-control-center/gnome-3-2] keyboard: Check for NULL value first



commit 05f0fe139621f413d035dcc7b1895b40f262e58a
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Oct 20 15:53:25 2011 +0100

    keyboard: Check for NULL value first
    
    Then try to access item->type

 panels/keyboard/keyboard-shortcuts.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/panels/keyboard/keyboard-shortcuts.c b/panels/keyboard/keyboard-shortcuts.c
index b518a2c..3a3e918 100644
--- a/panels/keyboard/keyboard-shortcuts.c
+++ b/panels/keyboard/keyboard-shortcuts.c
@@ -1136,12 +1136,12 @@ description_edited_callback (GtkCellRendererText *renderer,
                       DETAIL_KEYENTRY_COLUMN, &item,
                       -1);
 
-  g_assert (item->type == CC_KEYBOARD_ITEM_TYPE_GCONF_DIR);
-
   /* sanity check */
   if (item == NULL || item->desc_gconf_key == NULL)
     return;
 
+  g_assert (item->type == CC_KEYBOARD_ITEM_TYPE_GCONF_DIR);
+
   client = gconf_client_get_default ();
   if (!gconf_client_set_string (client, item->desc_gconf_key, new_text, NULL))
     item->desc_editable = FALSE;



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