From 64220656e94e3e8fd65c9e34e80322b0b14d66da Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Wed, 17 Aug 2022 07:11:15 -0400 Subject: [PATCH] Avoid missing null check in RC_TREE_MODEL::DeleteItems (cherry picked from commit 19e27ef587485dfa3acc35f7c233ad53d08e473e) --- common/rc_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/rc_item.cpp b/common/rc_item.cpp index 3171492aec..5fe781e793 100644 --- a/common/rc_item.cpp +++ b/common/rc_item.cpp @@ -466,7 +466,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