diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index d7f82de644..314bf1a934 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -5360,6 +5360,11 @@ enum Status { void DocumentObjectItem::testStatus(bool resetStatus, QIcon& icon1, QIcon& icon2) { + // guard against calling this during destruction when tree widget may be nullptr + if (!treeWidget()) { + return; + } + App::DocumentObject* pObject = object()->getObject(); int visible = -1;