diff options
author | Debarshi Ray <debarshir@gnome.org> | 2017-06-13 11:06:50 +0200 |
---|---|---|
committer | Debarshi Ray <debarshir@gnome.org> | 2017-06-13 21:59:36 +0200 |
commit | 2b48acbdf8849308cec8a8aa614822349abff2e7 (patch) | |
tree | 62fd5a67f4039ecb89af008ac8b6248fe677d6c7 /gtk | |
parent | 33b3985440b2c264085928b639732bd044b1d522 (diff) | |
download | gtk+-2b48acbdf8849308cec8a8aa614822349abff2e7.tar.gz |
GtkActionHelper: Remove unnecessary NULL check
This NULL check has existed since commit 652f16dd985dbc1b, when
GtkActionHelper was first introduced, but so has the assertion at the
top to ensure the validity of 'widget'.
https://bugzilla.gnome.org/show_bug.cgi?id=783587
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkactionhelper.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gtk/gtkactionhelper.c b/gtk/gtkactionhelper.c index 242528c921..41d3dd9cbd 100644 --- a/gtk/gtkactionhelper.c +++ b/gtk/gtkactionhelper.c @@ -387,22 +387,17 @@ GtkActionHelper * gtk_action_helper_new (GtkActionable *widget) { GtkActionHelper *helper; + GParamSpec *pspec; g_return_val_if_fail (GTK_IS_ACTIONABLE (widget), NULL); helper = g_object_new (GTK_TYPE_ACTION_HELPER, NULL); helper->widget = GTK_WIDGET (widget); + helper->enabled = gtk_widget_get_sensitive (GTK_WIDGET (helper->widget)); - if (helper->widget) - { - GParamSpec *pspec; - - helper->enabled = gtk_widget_get_sensitive (GTK_WIDGET (helper->widget)); - - pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (helper->widget), "active"); - if (pspec && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN) - g_object_get (G_OBJECT (helper->widget), "active", &helper->active, NULL); - } + pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (helper->widget), "active"); + if (pspec && G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN) + g_object_get (G_OBJECT (helper->widget), "active", &helper->active, NULL); helper->action_context = _gtk_widget_get_action_muxer (GTK_WIDGET (widget), TRUE); |