]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
To fix salome test test.hdfs. Prevent a crash in case aDoc does not exist
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Wed, 6 Sep 2023 14:59:24 +0000 (16:59 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Wed, 6 Sep 2023 14:59:24 +0000 (16:59 +0200)
src/ModuleBase/ModuleBase_Tools.cpp

index da130c0ac9a06b74b275ef34a64404568c5811c7..9afabf39448b121d86ad9eb99a9443122188622f 100644 (file)
@@ -1429,6 +1429,12 @@ void setDisplaying(ResultPartPtr thePart, bool theDisplayFromScript)
 
   isDoingDisplay = true;
   DocumentPtr aDoc = thePart->partDoc();
+
+  if (!aDoc) {
+    // Prevent a crash in case aDoc does not exist
+    return;
+  }
+
   int aConstructionSize = aDoc->size(ModelAPI_ResultConstruction::group());
   int aGroupSize = aDoc->size(ModelAPI_ResultGroup::group());
   int aFieldSize = aDoc->size(ModelAPI_ResultField::group());