]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
0023568: [CEA 2245] SALOME crashes when you dump a PARAVIS study in a script file
authormkr <margarita.karpunina@opencascade.com>
Thu, 21 Jun 2018 13:39:36 +0000 (16:39 +0300)
committervsr <vsr@opencascade.com>
Wed, 18 Jul 2018 11:20:10 +0000 (14:20 +0300)
Fix a bug

src/PVGUI/PVGUI_Module.cxx

index d1206bbca8f3df70a2c23ffe3ee7559cc030275d..342af676ab75f1572a9931a45c5f801de88a4a52 100644 (file)
@@ -846,7 +846,7 @@ QString PVGUI_Module::getTraceString()
     vtkPythonScopeGilEnsurer psge;
     PyObject * mods(PySys_GetObject(const_cast<char*>("modules")));
     PyObject * trace_mod(PyDict_GetItemString(mods, "paraview.smtrace"));  // module was already (really) imported by vtkSMTrace
-    if (PyModule_Check(trace_mod)) {
+    if (trace_mod && trace_mod != Py_None && PyModule_Check(trace_mod)) {
         vtkSmartPyObject save_cam(PyObject_GetAttrString(trace_mod, const_cast<char*>("SaveCameras")));
         vtkSmartPyObject camera_trace(PyObject_CallMethod(save_cam, const_cast<char*>("get_trace"), NULL));
         // Convert to a single string