diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | lib/widgets/ephy-editable-toolbar.c | 11 | ||||
-rwxr-xr-x | src/toolbar.c | 11 |
3 files changed, 23 insertions, 7 deletions
@@ -1,5 +1,13 @@ 2003-02-20 Marco Pesenti Gritti <marco@it.gnome.org> + * lib/widgets/ephy-editable-toolbar.c: (drag_data_received_cb): + * src/toolbar.c: (toolbar_get_action): + + Dont crash when dragging a new bookmark on the toolbar and + then click cancel. + +2003-02-20 Marco Pesenti Gritti <marco@it.gnome.org> + * lib/widgets/ephy-toolbars-group.c: (ephy_toolbars_group_to_string), (ephy_toolbars_group_remove_toolbar), diff --git a/lib/widgets/ephy-editable-toolbar.c b/lib/widgets/ephy-editable-toolbar.c index 799eec2d9..98b9afd47 100755 --- a/lib/widgets/ephy-editable-toolbar.c +++ b/lib/widgets/ephy-editable-toolbar.c @@ -225,11 +225,14 @@ drag_data_received_cb (GtkWidget *widget, } action = ephy_editable_toolbar_get_action (etoolbar, type, selection_data->data); - ephy_toolbars_group_add_item (etoolbar->priv->group, parent, sibling, - action->name); + if (action) + { + ephy_toolbars_group_add_item (etoolbar->priv->group, parent, sibling, + action->name); - etoolbar->priv->toolbars_dirty = TRUE; - queue_ui_update (etoolbar); + etoolbar->priv->toolbars_dirty = TRUE; + queue_ui_update (etoolbar); + } } static void diff --git a/src/toolbar.c b/src/toolbar.c index 1872a86eb..5929d718a 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -172,9 +172,14 @@ toolbar_get_action (EphyEditableToolbar *etoolbar, gtk_widget_destroy (new_bookmark); } - g_return_val_if_fail (id != 0, NULL); - - action = get_bookmark_action (t, bookmarks, id); + if (id != 0) + { + action = get_bookmark_action (t, bookmarks, id); + } + else + { + action = NULL; + } g_list_foreach (uris, (GFunc)g_free, NULL); g_list_free (uris); |