GtkTreeModel *model;
Device *device;
- gtk_tree_selection_get_selected(selection, &model, &iter);
+ if(!gtk_tree_selection_get_selected(selection, &model, &iter))
+ return;
+
gtk_tree_model_get(model, &iter, 1, &device, -1);
gtk_button_set_label(GTK_BUTTON(context->button), (device->mount_point ? "Unmount" : "Mount"));
}