Salome HOME
projects
/
modules
/
shaper.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
047a6c0
)
Fix to avoid crash in the issue #2360
author
mpv
<mpv@opencascade.com>
Wed, 13 Dec 2017 11:00:19 +0000
(14:00 +0300)
committer
mpv
<mpv@opencascade.com>
Wed, 13 Dec 2017 11:00:19 +0000
(14:00 +0300)
src/Model/Model_Objects.cpp
patch
|
blob
|
history
diff --git
a/src/Model/Model_Objects.cpp
b/src/Model/Model_Objects.cpp
index 35df5f6816e3d7f3e54d3ad451de29d91f38efff..77fd4bdfaa4473e8ab87594cfe25baf0cd166622 100644
(file)
--- 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<ObjectPtr>& 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];
}