diff --git a/src/common/docview.cpp b/src/common/docview.cpp index ffb5419ca2..8ff5adf858 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -630,8 +630,10 @@ wxView::wxView() wxView::~wxView() { - GetDocumentManager()->ActivateView(this, false); - m_viewDocument->RemoveView(this); + if (GetDocumentManager()) + GetDocumentManager()->ActivateView(this, false); + if (m_viewDocument) + m_viewDocument->RemoveView(this); } // Extend event processing to search the document's event table