GUI: Do not throw exception when platform is not set (#5099)
This commit is contained in:
parent
9d6449cc44
commit
8324b75ee0
|
@ -434,7 +434,7 @@ void ProjectFileDialog::saveToProjectFile(ProjectFile *projectFile) const
|
||||||
projectFile->setPlatform(mUI->mComboBoxPlatform->currentText());
|
projectFile->setPlatform(mUI->mComboBoxPlatform->currentText());
|
||||||
else {
|
else {
|
||||||
const int i = mUI->mComboBoxPlatform->currentIndex();
|
const int i = mUI->mComboBoxPlatform->currentIndex();
|
||||||
if (i < numberOfBuiltinPlatforms)
|
if (i>=0 && i < numberOfBuiltinPlatforms)
|
||||||
projectFile->setPlatform(cppcheck::Platform::toString(builtinPlatforms[i]));
|
projectFile->setPlatform(cppcheck::Platform::toString(builtinPlatforms[i]));
|
||||||
else
|
else
|
||||||
projectFile->setPlatform(QString());
|
projectFile->setPlatform(QString());
|
||||||
|
|
Loading…
Reference in New Issue