[Bf-blender-cvs] [05116408154] master: Fix assert on mouseover of blocks not using the layout system

Hans Goudey noreply at git.blender.org
Wed Nov 4 05:03:19 CET 2020


Commit: 05116408154c272ee459a1d6371411bfe94d1e84
Author: Hans Goudey
Date:   Tue Nov 3 22:03:08 2020 -0600
Branches: master
https://developer.blender.org/rB05116408154c272ee459a1d6371411bfe94d1e84

Fix assert on mouseover of blocks not using the layout system

When there was an active button in the "old" block from the last redraw,
this code tried to replace its pointer in the new block's button groups.
But in cases like the outliner or file browser, there are no groups
because the block doesn't use the layout system at all. This commit
just tweaks the assert to check whether there are any button groups.

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

M	source/blender/editors/interface/interface_button_group.c

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

diff --git a/source/blender/editors/interface/interface_button_group.c b/source/blender/editors/interface/interface_button_group.c
index 1f544831982..3d82b84399c 100644
--- a/source/blender/editors/interface/interface_button_group.c
+++ b/source/blender/editors/interface/interface_button_group.c
@@ -87,8 +87,8 @@ void ui_button_group_replace_but_ptr(uiBlock *block, const void *old_but_ptr, ui
     }
   }
 
-  /* The button should be in a group. */
-  BLI_assert(false);
+  /* The button should be in a group, otherwise there are no button groups at all. */
+  BLI_assert(BLI_listbase_is_empty(&block->button_groups));
 }
 
 /** \} */



More information about the Bf-blender-cvs mailing list