keyboard: Check for NULL value first

Then try to access item->type
This commit is contained in:
Bastien Nocera 2011-10-20 15:53:25 +01:00
parent 34dadb5ac3
commit 3d3cfa7304

View file

@ -1144,12 +1144,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;