From: mpv Date: Wed, 13 Dec 2017 11:00:19 +0000 (+0300) Subject: Fix to avoid crash in the issue #2360 X-Git-Tag: V_2.10.0RC~47 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=42a57d963513c237d74ebacea756654db4b9d036;p=modules%2Fshaper.git Fix to avoid crash in the issue #2360 --- diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 35df5f681..77fd4bdfa 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -564,6 +564,9 @@ ObjectPtr Model_Objects::object(const std::string& theGroupID, return ObjectPtr(); createHistory(theGroupID); const std::string& aGroupID = groupNameFoldering(theGroupID, theAllowFolder); + const std::vector& aVec = myHistory[theGroupID]; + if (aVec.size() <= theIndex) + return aVec[aVec.size() - 1]; // too high index requested (to avoid crash in #2360) return aGroupID.empty() ? myHistory[theGroupID][theIndex] : myHistory[aGroupID][theIndex]; }