[Bf-blender-cvs] [ae005393dce] master: Fix incorrect assert in Outliner ID deletion

Julian Eisel noreply at git.blender.org
Fri Mar 5 17:47:10 CET 2021


Commit: ae005393dce4746c0ee97887ea1a81281a1f726f
Author: Julian Eisel
Date:   Fri Mar 5 17:39:52 2021 +0100
Branches: master
https://developer.blender.org/rBae005393dce4746c0ee97887ea1a81281a1f726f

Fix incorrect assert in Outliner ID deletion

Mistake in aa3a4973a30f. The expanded `ELEM()` check would include
`0 && te->idcode != 0`, which always evaluates to `false`/`0`. That
wouldn't cause the asset to fail, but the `te->idcode` part would never
be checked.

Fixed the error and cleaned up the check against "0" with a check
against `TSE_SOME_ID`, see b9e54566e3b1a.

===================================================================

M	source/blender/editors/space_outliner/outliner_edit.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index c63209b6b60..18abe17d515 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -464,7 +464,8 @@ static void id_delete(bContext *C, ReportList *reports, TreeElement *te, TreeSto
   ID *id = tselem->id;
 
   BLI_assert(id != NULL);
-  BLI_assert(ELEM(tselem->type, 0 && te->idcode != 0, TSE_LAYER_COLLECTION));
+  BLI_assert(((tselem->type == TSE_SOME_ID) && (te->idcode != 0)) ||
+             (tselem->type == TSE_LAYER_COLLECTION));
   UNUSED_VARS_NDEBUG(te);
 
   if (te->idcode == ID_LI && ((Library *)id)->parent != NULL) {



More information about the Bf-blender-cvs mailing list