]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix fir the issue #2035 : crash on remove of depended Parts
authormpv <mpv@opencascade.com>
Wed, 22 Mar 2017 12:29:06 +0000 (15:29 +0300)
committermpv <mpv@opencascade.com>
Wed, 22 Mar 2017 12:29:06 +0000 (15:29 +0300)
src/Model/Model_ResultPart.cpp

index d3057534885e8e2b932c72a92b7451e862b12622..93830df4439592b7e13183b1432131460f41df3e 100644 (file)
@@ -48,7 +48,7 @@ void Model_ResultPart::initAttributes()
 
 std::shared_ptr<ModelAPI_Document> Model_ResultPart::partDoc()
 {
-  if (myTrsf.get()) {
+  if (myTrsf.get() && baseRef().get()) { // the second condition is to to #2035
     return baseRef()->partDoc();
   }
   DocumentPtr aRes = data()->document(DOC_REF())->value();
@@ -99,7 +99,7 @@ void Model_ResultPart::activate()
 
 std::shared_ptr<ModelAPI_ResultPart> Model_ResultPart::original()
 {
-  if (myTrsf.get()) {
+  if (myTrsf.get() && baseRef().get()) {  // the second condition is to to #2035
     return baseRef()->original();
   }
   return std::dynamic_pointer_cast<ModelAPI_ResultPart>(data()->owner());