Fix crash in History dialog.

This commit is contained in:
Roman Telezhynskyi 2024-03-01 14:32:19 +02:00
parent 18545d6355
commit 9c8ba7f997

View File

@ -151,12 +151,15 @@ void DialogHistory::cellClicked(int row, int column)
else else
{ {
QTableWidgetItem *item = ui->tableWidget->item(m_cursorToolRecordRow, 0); QTableWidgetItem *item = ui->tableWidget->item(m_cursorToolRecordRow, 0);
if (item != nullptr)
{
auto id = qvariant_cast<quint32>(item->data(Qt::UserRole)); auto id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, false); emit ShowHistoryTool(id, false);
}
m_cursorToolRecordRow = row; m_cursorToolRecordRow = row;
item = ui->tableWidget->item(m_cursorToolRecordRow, 0); item = ui->tableWidget->item(m_cursorToolRecordRow, 0);
id = qvariant_cast<quint32>(item->data(Qt::UserRole)); auto id = qvariant_cast<quint32>(item->data(Qt::UserRole));
emit ShowHistoryTool(id, true); emit ShowHistoryTool(id, true);
} }
} }