diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-03-22 19:53:19 +0000 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-03-22 19:53:19 +0000 |
commit | 0a7074927f2f600b6e7eb98459b97b73de0baa8d (patch) | |
tree | 17fdc92413bd0a354f0d36c0284df7aa0d6a45f4 /src/voip-input-widget.c | |
parent | 851b1bb2b1acaa5440f66d69948a066779ddf862 (diff) | |
download | ayatana-indicator-sound-0a7074927f2f600b6e7eb98459b97b73de0baa8d.tar.gz ayatana-indicator-sound-0a7074927f2f600b6e7eb98459b97b73de0baa8d.tar.bz2 ayatana-indicator-sound-0a7074927f2f600b6e7eb98459b97b73de0baa8d.zip |
protected now against any type ot irregular spam dbusmenu may throw at it
Diffstat (limited to 'src/voip-input-widget.c')
-rw-r--r-- | src/voip-input-widget.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/voip-input-widget.c b/src/voip-input-widget.c index dcf858e..1b36496 100644 --- a/src/voip-input-widget.c +++ b/src/voip-input-widget.c @@ -141,6 +141,7 @@ voip_input_widget_property_update (DbusmenuMenuitem* item, gchar* property, } if(g_ascii_strcasecmp(DBUSMENU_VOIP_INPUT_MENUITEM_MUTE, property) == 0){ if(priv->grabbed == FALSE){ + g_return_if_fail (g_variant_is_of_type (value, G_VARIANT_TYPE_INT32)); GtkWidget *slider = ido_scale_menu_item_get_scale((IdoScaleMenuItem*)priv->ido_voip_input_slider); GtkRange *range = (GtkRange*)slider; gint update = g_variant_get_int32 (value); @@ -149,8 +150,10 @@ voip_input_widget_property_update (DbusmenuMenuitem* item, gchar* property, level = 0; } else{ - level = g_variant_get_double (dbusmenu_menuitem_property_get_variant (priv->twin_item, - DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL)); + GVariant* variant = dbusmenu_menuitem_property_get_variant (priv->twin_item, + DBUSMENU_VOIP_INPUT_MENUITEM_LEVEL); + g_return_if_fail (g_variant_is_of_type (variant, G_VARIANT_TYPE_DOUBLE)); + level = g_variant_get_double (variant); } gtk_range_set_value(range, level); |