From f8ebc49382d23859d2dca88db2aaa67c51783835 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 2 Nov 2005 11:45:44 +0000 Subject: Return early when the action doesn't exist; don't crash. Patch by Peter 2005-11-02 Christian Persch * 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. --- lib/egg/egg-editable-toolbar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') 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); -- cgit v1.2.3