diff --git a/common/rc_item.cpp b/common/rc_item.cpp index a8b1ae1b0c..2396199300 100644 --- a/common/rc_item.cpp +++ b/common/rc_item.cpp @@ -480,7 +480,7 @@ void RC_TREE_MODEL::DeleteCurrentItem( bool aDeep ) void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, bool aDeep ) { - RC_TREE_NODE* current_node = ToNode( m_view->GetCurrentItem() ); + RC_TREE_NODE* current_node = m_view ? ToNode( m_view->GetCurrentItem() ) : nullptr; const std::shared_ptr current_item = current_node ? current_node->m_RcItem : nullptr; /// Keep a vector of elements to free after wxWidgets is definitely done accessing them