+ fix possible crash in parameter editor

This commit is contained in:
wmayer 2016-02-24 20:59:04 +01:00
parent 5342b67122
commit 35fa65ec96

View File

@ -265,10 +265,9 @@ void DlgParameterImp::onChangeParameterSet(int index)
hGrp = hGrp->GetGroup("ParameterEditor");
QString path = QString::fromUtf8(hGrp->GetASCII("LastParameterGroup").c_str());
QStringList paths = path.split(QLatin1String("."), QString::SkipEmptyParts);
if (paths.empty())
return;
QTreeWidgetItem* parent = 0;
for (int index=0; index < paramGroup->topLevelItemCount(); index++) {
for (int index=0; index < paramGroup->topLevelItemCount() && !paths.empty(); index++) {
QTreeWidgetItem* child = paramGroup->topLevelItem(index);
if (child->text(0) == paths.front()) {
paths.pop_front();