Avoid missing null check in RC_TREE_MODEL::DeleteItems

This commit is contained in:
Marek Roszko 2022-08-17 07:11:15 -04:00
parent 34b38eb95b
commit 19e27ef587
1 changed files with 1 additions and 1 deletions

View File

@ -480,7 +480,7 @@ void RC_TREE_MODEL::DeleteCurrentItem( bool aDeep )
void RC_TREE_MODEL::DeleteItems( bool aCurrentOnly, bool aIncludeExclusions, 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<RC_ITEM> current_item = current_node ? current_node->m_RcItem : nullptr; const std::shared_ptr<RC_ITEM> current_item = current_node ? current_node->m_RcItem : nullptr;
/// Keep a vector of elements to free after wxWidgets is definitely done accessing them /// Keep a vector of elements to free after wxWidgets is definitely done accessing them