aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-02-21 00:24:41 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-02-21 00:24:41 +0800
commita923f76715c4cca404b318f5370b8098b4b0a83f (patch)
tree7d25164ecfe2740aaf5ce8b04e0ac54ce5003979
parent443bb3dcad6c71a4d847091e5655d66e475742bd (diff)
downloadgsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.tar
gsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.tar.gz
gsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.tar.bz2
gsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.tar.lz
gsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.tar.xz
gsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.tar.zst
gsoc2013-epiphany-a923f76715c4cca404b318f5370b8098b4b0a83f.zip
Dont crash when dragging a new bookmark on the toolbar and then click
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.
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/widgets/ephy-editable-toolbar.c11
-rwxr-xr-xsrc/toolbar.c11
3 files changed, 23 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 7b200b674..c8eac12e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);