Salome HOME
Issue #1351: partition is not done
[modules/shaper.git] / src / ModuleBase / ModuleBase_ISelection.cpp
index 72f1e4df8337efcd78e60bbe2f48409855b611e5..d5c325558b186df333cc949b379e9a2fef344754 100644 (file)
@@ -38,13 +38,12 @@ ResultPtr ModuleBase_ISelection::getResult(const ModuleBase_ViewerPrs& thePrs)
 {
   ResultPtr aResult;
 
-  if (!thePrs.owner().IsNull()) {
+  if (thePrs.object().get())
+    aResult = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs.object());
+  else if (!thePrs.owner().IsNull()) {
     ObjectPtr anObject = getSelectableObject(thePrs.owner());
     aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
   }
-  else {
-    aResult = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs.object());
-  }
 
   return aResult;
 }