From 840a4a9d923ec9eedd5d6f64987c93ca107151b2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 5 Nov 2015 14:06:45 +0200 Subject: [PATCH] Fixed crash after language change. --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 360a6a93d..4cc409115 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -496,12 +496,15 @@ void TMainWindow::changeEvent(QEvent *event) { labelPatternUnit = new QLabel(tr("Pattern unit:")); - const qint32 index = comboBoxUnits->currentIndex(); - comboBoxUnits->blockSignals(true); - comboBoxUnits->clear(); - InitComboBoxUnits(); - comboBoxUnits->setCurrentIndex(index); - comboBoxUnits->blockSignals(false); + if (comboBoxUnits != nullptr) + { + const qint32 index = comboBoxUnits->currentIndex(); + comboBoxUnits->blockSignals(true); + comboBoxUnits->clear(); + InitComboBoxUnits(); + comboBoxUnits->setCurrentIndex(index); + comboBoxUnits->blockSignals(false); + } } }