Fix a crash if a table widget gets a copy shortcut with no selection

This commit is contained in:
baldurk committed 2021-05-19 11:44:41 +01:00
1 parent 2005d2d08e
commit 00e1f0056d
1 file changed
+3
@@ -101,6 +101,9 @@ void RDTableWidget::copySelection()
{
QList<QTableWidgetItem *> items = selectedItems();
if(items.empty())
return;
std::sort(items.begin(), items.end(), [this](QTableWidgetItem *a, QTableWidgetItem *b) {
if(row(a) != row(b))
return row(a) < row(b);