[evince] toolbar-editor: Fix a crash when dropping an item to the toolbar
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] toolbar-editor: Fix a crash when dropping an item to the toolbar
- Date: Mon, 6 Feb 2012 17:49:41 +0000 (UTC)
commit c528881454c18ab29e300c3e3f2726409806eed3
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Mon Feb 6 18:08:37 2012 +0100
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.
cut-n-paste/toolbar-editor/egg-editable-toolbar.c | 8 ++++++--
1 files changed, 6 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 a27b88a..89dc867 100644
--- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
+++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c
@@ -605,9 +605,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)
{
gtk_widget_set_sensitive (GTK_WIDGET (item), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]