mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Avoid crash when wellPath size = 0
This commit is contained in:
parent
e8c5666c44
commit
359ac1cbd7
@ -68,10 +68,9 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
|
||||
|
||||
if (!oilField) return;
|
||||
|
||||
size_t lastIdx = oilField->wellPathCollection->wellPaths().size() - 1;
|
||||
if (lastIdx >= 0)
|
||||
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
||||
{
|
||||
RimWellPath* wellPath = oilField->wellPathCollection->wellPaths()[lastIdx];
|
||||
RimWellPath* wellPath = oilField->wellPathCollection->wellPaths()[oilField->wellPathCollection->wellPaths().size() - 1];
|
||||
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user