aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-15 19:07:47 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-08-15 20:03:28 +0800
commitd6be6c7eb33dbd96e4c8f72369b9a9816fc23492 (patch)
tree0f72e94d6dca099ed86ae2c14019aa8f449bb656 /src
parent9a592ec3ab386ef2f959fb9737ab85c760c03324 (diff)
downloadgsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.tar
gsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.tar.gz
gsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.tar.bz2
gsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.tar.lz
gsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.tar.xz
gsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.tar.zst
gsoc2013-empathy-d6be6c7eb33dbd96e4c8f72369b9a9816fc23492.zip
CameraMenu: don't crash if there are no cameras
Diffstat (limited to 'src')
-rw-r--r--src/empathy-camera-menu.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/empathy-camera-menu.c b/src/empathy-camera-menu.c
index b38cc5f1d..6a7d20c15 100644
--- a/src/empathy-camera-menu.c
+++ b/src/empathy-camera-menu.c
@@ -246,7 +246,7 @@ empathy_camera_menu_prefs_camera_changed_cb (GSettings *settings,
EmpathyCameraMenu *self)
{
gchar *device = g_settings_get_string (settings, key);
- GtkRadioAction *action;
+ GtkRadioAction *action = NULL;
gboolean found = FALSE;
GList *l;
@@ -266,10 +266,11 @@ empathy_camera_menu_prefs_camera_changed_cb (GSettings *settings,
/* If the selected camera isn't found, we connect the first
* available one */
- if (!found)
+ if (!found && self->priv->cameras->head != NULL)
action = self->priv->cameras->head->data;
- if (!gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
+ if (action != NULL &&
+ !gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
{
g_signal_handlers_block_by_func (settings,
empathy_camera_menu_prefs_camera_changed_cb, self);