mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 16:32:12 -05:00
Avoid crash when wellPath size = 0
This commit is contained in:
1 parent
e8c5666c44
commit
359ac1cbd7
1 file changed
+2
-3
@@ -68,10 +68,9 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
|
|||||||
|
|
||||||
if (!oilField) return;
|
if (!oilField) return;
|
||||||
|
|
||||||
size_t lastIdx = oilField->wellPathCollection->wellPaths().size() - 1;
|
if (oilField->wellPathCollection->wellPaths().size() > 0)
|
||||||
if (lastIdx >= 0)
|
|
||||||
{
|
{
|
||||||
RimWellPath* wellPath = oilField->wellPathCollection->wellPaths()[lastIdx];
|
RimWellPath* wellPath = oilField->wellPathCollection->wellPaths()[oilField->wellPathCollection->wellPaths().size() - 1];
|
||||||
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user