diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index dab66a874b..30eaf2a56a 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -2135,6 +2135,9 @@ Py::Object View3DInventorPy::getSceneGraph() { try { SoNode* scene = getView3DInventorPtr()->getViewer()->getSceneGraph(); + if (scene == nullptr) { + return Py::None(); + } PyObject* proxy = nullptr; proxy = Base::Interpreter().createSWIGPointerObj("pivy.coin", "SoSeparator *", static_cast(scene), 1); scene->ref();