From dc11cbd4c5ee7c8446eeec5c85470e75054ba9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Tue, 14 Nov 2017 11:35:33 +0100 Subject: [PATCH] WellPathCollection. Fix crash --- .../ProjectDataModel/RimWellPathCollection.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp index 4a42bfda7b..8b32ddd6da 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathCollection.cpp @@ -244,6 +244,11 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector& wellP interpolatedWellColors = caf::ColorTable::interpolateColorArray(wellColors, wellPathArray.size()); } + if (!wellPathArray.empty()) + { + m_newestAddedWellName = wellPathArray.back()->name(); + } + for (size_t wpIdx = 0; wpIdx < wellPathArray.size(); wpIdx++) { RimWellPath* wellPath = wellPathArray[wpIdx]; @@ -274,11 +279,6 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector& wellP progress.incrementProgress(); } - if (!wellPathArray.empty()) - { - m_newestAddedWellName = wellPathArray.back()->name(); - } - this->sortWellsByName(); }