Fix potential crash.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-08-02 15:03:15 +03:00
parent e1cfe78077
commit ed5ac37256

View File

@ -1513,7 +1513,15 @@ void TMainWindow::ShowNewMData(bool fresh)
{
MFields(true);
if (ui->tableWidget->currentRow() == -1)
{
ui->tableWidget->blockSignals(true);
ui->tableWidget->selectRow(0);
ui->tableWidget->blockSignals(false);
}
const QTableWidgetItem *nameField = ui->tableWidget->item(ui->tableWidget->currentRow(), ColumnName); // name
SCASSERT(nameField != nullptr)
QSharedPointer<VMeasurement> meash;
try