Fix crash.
Valentina crashes if highlighted from history dialog tool was removed.
This commit is contained in:
parent
1be20e0b46
commit
e4674f6058
|
@ -87,8 +87,11 @@ DialogHistory::~DialogHistory()
|
|||
void DialogHistory::DialogAccepted()
|
||||
{
|
||||
QTableWidgetItem *item = ui->tableWidget->item(cursorToolRecordRow, 0);
|
||||
quint32 id = qvariant_cast<quint32>(item->data(Qt::UserRole));
|
||||
emit ShowHistoryTool(id, false);
|
||||
if (item != nullptr)
|
||||
{
|
||||
auto id = qvariant_cast<quint32>(item->data(Qt::UserRole));
|
||||
emit ShowHistoryTool(id, false);
|
||||
}
|
||||
emit DialogClosed(QDialog::Accepted);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user