mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-13 00:42:12 -05:00
AppFwk: Line Editor: Guard for index out of range
This commit is contained in:
1 parent
e0b0fb1c13
commit
7be8227efa
1 file changed
+5
-1
@@ -223,7 +223,11 @@ void PdmUiLineEditor::configureAndUpdateUi(const QString& uiConfigName)
|
||||
if (!enumNames.isEmpty() && fromMenuOnly == true)
|
||||
{
|
||||
int enumValue = field()->uiValue().toInt();
|
||||
m_lineEdit->setText(enumNames[enumValue].optionUiText());
|
||||
|
||||
if (enumValue < enumNames.size() && enumValue > -1)
|
||||
{
|
||||
m_lineEdit->setText(enumNames[enumValue].optionUiText());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user