diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index e89cc6ffb0..c5194a2770 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -681,7 +681,7 @@ void Document::RestoreDocFile(Base::Reader &reader) ViewProvider* pObj = getViewProviderByName(name.c_str()); if (pObj) // check if this feature has been registered pObj->Restore(xmlReader); - if (expanded) { + if (pObj && expanded) { Gui::ViewProviderDocumentObject* vp = static_cast(pObj); this->signalExpandObject(*vp, Gui::Expand); }