diff --git a/src/NWindow.cc b/src/NWindow.cc index 57322c2..fedf798 100644 --- a/src/NWindow.cc +++ b/src/NWindow.cc @@ -184,7 +184,10 @@ void NWindow::sighandle_click_apply (void) { void NWindow::apply_bg () { // find out which image is currently selected - Gtk::TreeModel::iterator iter = view.get_selected (); + Gtk::TreeModel::iterator iter = view.get_selected(); + if (!iter) + return; + Gtk::TreeModel::Row row = *iter; Glib::ustring file = row[view.record.Filename]; bool saveToConfig = this->set_bg(file); diff --git a/src/Thumbview.cc b/src/Thumbview.cc index 51eb326..da29674 100644 --- a/src/Thumbview.cc +++ b/src/Thumbview.cc @@ -624,6 +624,9 @@ Gtk::TreeModel::iterator Thumbview::get_selected() if (m_curmode == ICON) { std::list selected = iview.get_selected_items(); + if (selected.size() == 0) + return store->children().end(); + return store->get_iter(*(selected.begin())); } else