Fix T101233: Crash on deleting the object in outliner due to null pointer access

After rB188f7585a183 deleting the object results in crash due
to null pointer access if collections are filtered out

Reviewed by: mont29

Differential Revision: https://developer.blender.org/D16031
This commit is contained in:
Pratik Borhade 2022-10-04 20:49:34 +05:30 committed by Thomas Dinges
parent 5a1ef2dc78
commit 28e09980a2
Notes: blender-bot 2023-02-14 00:29:15 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
Referenced by issue #101233, Regression: Deleting Object in outliner with a specific filter setting crashes Blender.
1 changed files with 1 additions and 1 deletions

View File

@ -2351,7 +2351,7 @@ static TreeTraversalAction outliner_find_objects_to_delete(TreeElement *te, void
/* Do not allow to delete children objects of an override collection. */
TreeElement *te_parent = te->parent;
if (outliner_is_collection_tree_element(te_parent)) {
if (te_parent != nullptr && outliner_is_collection_tree_element(te_parent)) {
TreeStoreElem *tselem_parent = TREESTORE(te_parent);
ID *id_parent = tselem_parent->id;
BLI_assert(GS(id_parent->name) == ID_GR);