Commit: b0752cd7a05187923fcbdfba974899a6039cfd2c
Author: Brecht Van Lommel
Date:   Mon Mar 18 19:56:14 2019 +0100
Branches: master
https://developer.blender.org/rBb0752cd7a05187923fcbdfba974899a6039cfd2c

Fix T57590: assert with zero length array buttons.

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

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

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

diff --git a/source/blender/editors/interface/interface_utils.c 
b/source/blender/editors/interface/interface_utils.c
index 7400e922b30..85eae9a253d 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -61,9 +61,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, 
PropertyRNA *prop, int ind
        switch (RNA_property_type(prop)) {
                case PROP_BOOLEAN:
                {
-                       int arraylen = RNA_property_array_length(ptr, prop);
-
-                       if (arraylen && index == -1)
+                       if (RNA_property_array_check(prop) && index == -1)
                                return NULL;
 
                        if (icon && name && name[0] == '\0')
@@ -77,9 +75,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, 
PropertyRNA *prop, int ind
                case PROP_INT:
                case PROP_FLOAT:
                {
-                       int arraylen = RNA_property_array_length(ptr, prop);
-
-                       if (arraylen && index == -1) {
+                       if (RNA_property_array_check(prop) && index == -1) {
                                if (ELEM(RNA_property_subtype(prop), 
PROP_COLOR, PROP_COLOR_GAMMA)) {
                                        but = uiDefButR_prop(block, 
UI_BTYPE_COLOR, 0, name, x1, y1, x2, y2, ptr, prop, -1, 0, 0, -1, -1, NULL);
                                }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to