Avoid crash when wellPath size = 0

This commit is contained in:
Rebecca Cox 2017-10-23 08:48:44 +02:00
parent e8c5666c44
commit 359ac1cbd7

View File

@ -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);
}
}