From 73416d200f6a1ccce28781321bc670acf83a858d Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 21 Jun 2004 11:30:51 +0000 Subject: Check for empty attributes before adding the item when parsing the 2004-06-21 Christian Persch * lib/egg/egg-toolbars-model.c: (parse_item_list): Check for empty attributes before adding the item when parsing the toolbars file. Should fix bug #144698 --- ChangeLog | 7 +++++++ lib/egg/egg-toolbars-model.c | 17 ++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18b9c833b..d12c625e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-06-21 Christian Persch + + * lib/egg/egg-toolbars-model.c: (parse_item_list): + + Check for empty attributes before adding the item when parsing + the toolbars file. Should fix bug #144698 + 2004-06-21 Christian Persch * src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import): diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c index 0da5cbd69..0e308c472 100755 --- a/lib/egg/egg-toolbars-model.c +++ b/lib/egg/egg-toolbars-model.c @@ -361,17 +361,20 @@ parse_item_list (EggToolbarsModel *t, type = xmlGetProp (child, "type"); if (type == NULL) { - type = g_strdup (EGG_TOOLBAR_ITEM_TYPE); + type = xmlStrdup (EGG_TOOLBAR_ITEM_TYPE); } - id = egg_toolbars_model_get_item_id (t, type, name); - if (id != NULL) + if (name != NULL && name[0] != '\0' && type != NULL) { - egg_toolbars_model_add_item (t, position, -1, id, type); - } + id = egg_toolbars_model_get_item_id (t, type, name); + if (id != NULL) + { + egg_toolbars_model_add_item (t, position, -1, id, type); + } + g_free (id); + } xmlFree (name); - g_free (type); - g_free (id); + xmlFree (type); } else if (xmlStrEqual (child->name, "separator")) { -- cgit v1.2.3