aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-11-02 19:45:44 +0800
committerChristian Persch <chpe@src.gnome.org>2005-11-02 19:45:44 +0800
commitf8ebc49382d23859d2dca88db2aaa67c51783835 (patch)
treeb519323a37b73f27609ce06d664bf2140a9bea9c
parentbc3b0bd4cc7331f542abb99a36156e32b3e53021 (diff)
downloadgsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.tar
gsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.tar.gz
gsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.tar.bz2
gsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.tar.lz
gsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.tar.xz
gsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.tar.zst
gsoc2013-epiphany-f8ebc49382d23859d2dca88db2aaa67c51783835.zip
Return early when the action doesn't exist; don't crash. Patch by Peter
2005-11-02 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-editable-toolbar.c: (create_item_from_action), (item_added_cb): Return early when the action doesn't exist; don't crash. Patch by Peter Harvey.
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/egg/egg-editable-toolbar.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ae9cce7d5..bf5fd90fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-11-02 Christian Persch <chpe@cvs.gnome.org>
+ * lib/egg/egg-editable-toolbar.c: (create_item_from_action),
+ (item_added_cb):
+
+ Return early when the action doesn't exist; don't crash.
+ Patch by Peter Harvey.
+
+2005-11-02 Christian Persch <chpe@cvs.gnome.org>
+
* data/ui/epiphany-fs-toolbar.xml:
Remove spinner from fullscreen toolbars file.
diff --git a/lib/egg/egg-editable-toolbar.c b/lib/egg/egg-editable-toolbar.c
index 4f55bd3b0..3d69c8fc0 100755
--- a/lib/egg/egg-editable-toolbar.c
+++ b/lib/egg/egg-editable-toolbar.c
@@ -687,7 +687,8 @@ create_item_from_action (EggEditableToolbar *etoolbar,
else
{
GtkAction *action = find_action (etoolbar, name);
- g_return_val_if_fail (action != NULL, NULL);
+ if (action == NULL) return NULL;
+
item = GTK_TOOL_ITEM (gtk_action_create_tool_item (action));
/* Normally done on-demand by the GtkUIManager, but no
@@ -1083,6 +1084,8 @@ item_added_cb (EggToolbarsModel *model,
toolbar = get_toolbar_nth (etoolbar, tpos);
item = create_item_from_position (etoolbar, tpos, ipos);
+ if (item == NULL) return;
+
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, ipos);
connect_widget_signals (GTK_WIDGET (item), etoolbar);