summaryrefslogtreecommitdiff
path: root/sendto
diff options
context:
space:
mode:
authorMonsta <[email protected]>2015-01-05 18:54:36 +0300
committerStefano Karapetsas <[email protected]>2015-01-14 08:02:42 +0100
commit6d8a1029bf7b6fee68d2f62b9b70b6474da83fd8 (patch)
tree35b744383303608e4f19c6c702da90f8b5237442 /sendto
parentb28ea563892bcf8d708ad92cb10783c847c5e496 (diff)
downloadcaja-extensions-6d8a1029bf7b6fee68d2f62b9b70b6474da83fd8.tar.bz2
caja-extensions-6d8a1029bf7b6fee68d2f62b9b70b6474da83fd8.tar.xz
sendto: safer access to list element's data
g_list_nth_data just returns NULL if either list or element is NULL Closes https://github.com/mate-desktop/caja-extensions/pull/11
Diffstat (limited to 'sendto')
-rw-r--r--sendto/caja-sendto-command.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sendto/caja-sendto-command.c b/sendto/caja-sendto-command.c
index 6e30885..ede4774 100644
--- a/sendto/caja-sendto-command.c
+++ b/sendto/caja-sendto-command.c
@@ -375,17 +375,17 @@ toggle_pack_check (GtkWidget *widget, NS_ui *ui)
static void
option_changed (GtkComboBox *cb, NS_ui *ui)
{
- GList *aux;
+ GtkWidget *w;
NstPlugin *p;
gboolean supports_dirs = FALSE;
- aux = g_list_nth (ui->contact_widgets, option);
+ w = g_list_nth_data (ui->contact_widgets, option);
option = gtk_combo_box_get_active (GTK_COMBO_BOX(cb));
- gtk_widget_hide ((GtkWidget *) aux->data);
- aux = g_list_nth (ui->contact_widgets, option);
- gtk_widget_show ((GtkWidget *) aux->data);
+ gtk_widget_hide (w);
+ w = g_list_nth_data (ui->contact_widgets, option);
+ gtk_widget_show (w);
- gtk_label_set_mnemonic_widget (GTK_LABEL (ui->send_to_label), aux->data);
+ gtk_label_set_mnemonic_widget (GTK_LABEL (ui->send_to_label), w);
p = (NstPlugin *) g_list_nth_data (plugin_list, option);
supports_dirs = (p->info->capabilities & CAJA_CAPS_SEND_DIRECTORIES);