summaryrefslogtreecommitdiff
path: root/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2015-06-14 12:04:15 +0200
committerraveit65 <[email protected]>2015-06-14 12:04:15 +0200
commitfbbdd73f7b53b41a56ad79e412583c6a39141dc4 (patch)
treee8180ada8196e37da6a3d20079915cc8c69296e7 /cut-n-paste/toolbar-editor/egg-editable-toolbar.c
parent309ba23a39b9f9fb6cbbc816d94f656bc66e3882 (diff)
downloadeom-fbbdd73f7b53b41a56ad79e412583c6a39141dc4.tar.bz2
eom-fbbdd73f7b53b41a56ad79e412583c6a39141dc4.tar.xz
toolbar-editor: Fix a crash when dropping an item to the toolbar
action_sensitive_cb can be called with the dnd tool item when it doesn't have an ancestor. taken from: https://git.gnome.org/browse/eog/commit/?id=c754959
Diffstat (limited to 'cut-n-paste/toolbar-editor/egg-editable-toolbar.c')
-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)
{