Prevent crash when removing records

This commit is contained in:
Vladislav Tronko
2016-05-14 18:50:48 +03:00
parent 4faf6d2598
commit 330af1a6a9

View File

@@ -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())
{