def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD):

study = smeshpyD.GetCurrentStudy()
+        if not study: return None
         scomp = study.FindComponent(smeshpyD.ComponentDataType())
This commit is contained in:
eap 2013-03-06 16:03:18 +00:00
parent f3304d692b
commit 77f09a6ae5

View File

@ -71,6 +71,7 @@ class Mesh_Algorithm:
# @return SMESH.SMESH_Hypothesis # @return SMESH.SMESH_Hypothesis
def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD): def FindHypothesis (self, hypname, args, CompareMethod, smeshpyD):
study = smeshpyD.GetCurrentStudy() study = smeshpyD.GetCurrentStudy()
if not study: return None
#to do: find component by smeshpyD object, not by its data type #to do: find component by smeshpyD object, not by its data type
scomp = study.FindComponent(smeshpyD.ComponentDataType()) scomp = study.FindComponent(smeshpyD.ComponentDataType())
if scomp is not None: if scomp is not None: