Skip to content

Commit

Permalink
[Gui] Add check for document in VPDocumentObject::getActiveView
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorus committed Jul 5, 2024
1 parent 94d101d commit fb7ccb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Gui/ViewProviderDocumentObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ Gui::MDIView* ViewProviderDocumentObject::getActiveView() const
{
if(!pcObject)
throw Base::RuntimeError("View provider detached");
if (!pcObject->isAttachedToDocument()) {
return nullptr;
}
App::Document* pAppDoc = pcObject->getDocument();
Gui::Document* pGuiDoc = Gui::Application::Instance->getDocument(pAppDoc);
return pGuiDoc->getActiveView();
Expand Down

0 comments on commit fb7ccb8

Please sign in to comment.