diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-18 21:56:14 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-18 21:56:14 +0300 |
commit | b0752cd7a05187923fcbdfba974899a6039cfd2c (patch) | |
tree | b69f1c4e1183024372a762f53db19a366bb3d83b /source/blender/editors/interface/interface_utils.c | |
parent | 10d1edbffbf91094015950555495e01914e09dd9 (diff) |
Fix T57590: assert with zero length array buttons.
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 8 |
1 files changed, 2 insertions, 6 deletions
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); } |