From 330af1a6a9077c977f645c89109b791c90b45dc9 Mon Sep 17 00:00:00 2001 From: Vladislav Tronko Date: Sat, 14 May 2016 18:50:48 +0300 Subject: [PATCH] Prevent crash when removing records --- src/MainWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 28a992d95..e988ed401 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -577,6 +577,10 @@ void MainWindow::deleteRecord() { if(ui->dataTable->selectionModel()->hasSelection()) { + // If only filter header is selected + if(ui->dataTable->selectionModel()->selectedIndexes().isEmpty()) + return; + int old_row = ui->dataTable->currentIndex().row(); while(ui->dataTable->selectionModel()->hasSelection()) {