From: Mikko Rasa Date: Thu, 25 Feb 2016 18:28:00 +0000 (+0200) Subject: Do nothing if there is no selection X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4e40d30307c5235b74174138ca9c5071ca654201;p=pmount-gui.git Do nothing if there is no selection --- diff --git a/main.c b/main.c index 24b87fc..ce9ac69 100644 --- a/main.c +++ b/main.c @@ -777,7 +777,9 @@ void selection_changed(GtkTreeSelection *selection, gpointer user_data) 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")); }