Don't crash if the model is badly defined in wxGTK wxDVC
Asserting before dereferencing a null pointer (in BuildBranch(), called immediately after the asserts in question) is useless, as usual. Use wxCHECK to complain and avoid crashing instead. Closes #17776.
This commit is contained in:
@@ -4041,7 +4041,7 @@ gboolean wxDataViewCtrlInternal::iter_children( GtkTreeIter *iter, GtkTreeIter *
|
||||
return FALSE;
|
||||
|
||||
wxGtkTreeModelNode *parent_node = FindNode( parent );
|
||||
wxASSERT_MSG(parent_node,
|
||||
wxCHECK_MSG(parent_node, FALSE,
|
||||
"Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
|
||||
|
||||
BuildBranch( parent_node );
|
||||
@@ -4081,7 +4081,7 @@ gboolean wxDataViewCtrlInternal::iter_has_child( GtkTreeIter *iter )
|
||||
return FALSE;
|
||||
|
||||
wxGtkTreeModelNode *node = FindNode( iter );
|
||||
wxASSERT_MSG(node,
|
||||
wxCHECK_MSG(node, FALSE,
|
||||
"Did you forget a call to ItemAdded()? The iterator is unknown to the wxGtkTreeModel");
|
||||
|
||||
BuildBranch( node );
|
||||
@@ -4112,7 +4112,7 @@ gint wxDataViewCtrlInternal::iter_n_children( GtkTreeIter *iter )
|
||||
return 0;
|
||||
|
||||
wxGtkTreeModelNode *parent_node = FindNode( iter );
|
||||
wxASSERT_MSG(parent_node,
|
||||
wxCHECK_MSG(parent_node, FALSE,
|
||||
"Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
|
||||
|
||||
BuildBranch( parent_node );
|
||||
@@ -4152,7 +4152,7 @@ gboolean wxDataViewCtrlInternal::iter_nth_child( GtkTreeIter *iter, GtkTreeIter
|
||||
return FALSE;
|
||||
|
||||
wxGtkTreeModelNode *parent_node = FindNode( parent );
|
||||
wxASSERT_MSG(parent_node,
|
||||
wxCHECK_MSG(parent_node, FALSE,
|
||||
"Did you forget a call to ItemAdded()? The parent node is unknown to the wxGtkTreeModel");
|
||||
|
||||
BuildBranch( parent_node );
|
||||
|
Reference in New Issue
Block a user