From cb9093c7d864ef914d7b1fea6596108e4ac8aa04 Mon Sep 17 00:00:00 2001 From: Andrew Higginson Date: Tue, 27 Dec 2011 21:05:11 +0000 Subject: fixed crash! (bzr r10092.1.37) --- src/ui/dialog/ocaldialogs.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp index db3d1272a..3ec1f687e 100644 --- a/src/ui/dialog/ocaldialogs.cpp +++ b/src/ui/dialog/ocaldialogs.cpp @@ -636,8 +636,10 @@ void ImportDialog::on_list_results_selection_changed() pathlist = list_results->get_selection()->get_selected_rows(); std::vector posArray(1); - printf("%s", "on_list_results_selection_changed\n"); - + // If nothing is selected, then return + if (((int) pathlist.size()) < 1) { + return; + } posArray = pathlist[0].get_indices(); int row = posArray[0]; @@ -653,8 +655,10 @@ void ImportDialog::on_button_import_clicked() { pathlist = list_results->get_selection()->get_selected_rows(); std::vector posArray(1); - printf("%s", "on_button_import_clicked\n"); - + // If nothing is selected, then return + if (((int) pathlist.size()) < 1) { + return; + } posArray = pathlist[0].get_indices(); int row = posArray[0]; @@ -674,8 +678,10 @@ void ImportDialog::on_list_results_cursor_changed() pathlist = list_results->get_selection()->get_selected_rows(); std::vector posArray(1); - printf("%s", "on_list_results_cursor_changed\n"); - + // If nothing is selected, then return + if (((int) pathlist.size()) < 1) { + return; + } posArray = pathlist[0].get_indices(); int row = posArray[0]; -- cgit v1.2.3