summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cut-n-paste/toolbar-editor/egg-editable-toolbar.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
index 006980e..b8ea050 100644
--- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
+++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
@@ -549,8 +549,13 @@ action_sensitive_cb (GtkAction *action,
GParamSpec *pspec,
GtkToolItem *item)
{
- EggEditableToolbar *etoolbar = EGG_EDITABLE_TOOLBAR
- (gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR));
+ EggEditableToolbar *etoolbar;
+ GtkWidget *ancestor = gtk_widget_get_ancestor (GTK_WIDGET (item), EGG_TYPE_EDITABLE_TOOLBAR);
+
+ if (!ancestor)
+ return;
+
+ etoolbar = EGG_EDITABLE_TOOLBAR (ancestor);
if (etoolbar->priv->edit_mode > 0)
{